mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
16 lines
459 B
TypeScript
16 lines
459 B
TypeScript
jest.mock('../_util/getReactMajorVersionCanDelMe', () => {
|
|
return () => 17;
|
|
});
|
|
|
|
describe('antd legacy', () => {
|
|
it('should warn when React version is below 18', () => {
|
|
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
|
|
|
require('..');
|
|
|
|
expect(errorSpy).toHaveBeenCalledWith(
|
|
'Warning: [antd: version] antd v6 no longer supports React versions below 18. Please upgrade to React 18 or higher.',
|
|
);
|
|
});
|
|
});
|