Files
2026-07-13 12:38:36 +08:00

27 lines
788 B
TypeScript

describe('@nx/react/tailwind deprecation warning', () => {
let warnSpy: jest.SpyInstance;
beforeEach(() => {
jest.resetModules();
warnSpy = jest.spyOn(console, 'warn').mockImplementation(() => {});
});
afterEach(() => {
warnSpy.mockRestore();
});
it('warns once per process when createGlobPatternsForDependencies is invoked', () => {
const { createGlobPatternsForDependencies } = require('./tailwind');
createGlobPatternsForDependencies('/does/not/exist');
createGlobPatternsForDependencies('/does/not/exist');
const deprecationWarnings = warnSpy.mock.calls.filter(
([msg]) =>
typeof msg === 'string' &&
msg.includes('"@nx/react/tailwind" is deprecated')
);
expect(deprecationWarnings).toHaveLength(1);
});
});