Files
ant-design/components/__tests__/index.test.ts
二货爱吃白萝卜 b296ccb192 chore: warning tips (#55745)
* chore: warning tips

* test: update snapshot

* chore: warning for verson
2025-11-18 15:05:06 +08:00

26 lines
738 B
TypeScript

const OLD_NODE_ENV = process.env.NODE_ENV;
process.env.NODE_ENV = 'development';
const antd = require('..');
describe('antd', () => {
afterAll(() => {
process.env.NODE_ENV = OLD_NODE_ENV;
});
it('exports modules correctly', () => {
expect(Object.keys(antd)).toMatchSnapshot();
});
it('unstableSetRender should show correct warning message', () => {
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
antd.unstableSetRender();
expect(errorSpy).toHaveBeenCalledWith(
"Warning: [antd: compatible] antd v6 support React 19 already, it's no need to call the compatible function or just remove `@ant-design/v5-patch-for-react-19`",
);
errorSpy.mockRestore();
});
});