mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-16 01:41:02 +08:00
22 lines
656 B
JavaScript
22 lines
656 B
JavaScript
const OLD_NODE_ENV = process.env.NODE_ENV;
|
|
process.env.NODE_ENV = 'development';
|
|
const warnSpy = jest.spyOn(console, 'warn').mockImplementation(() => {});
|
|
const antd = require('..');
|
|
|
|
describe('antd', () => {
|
|
afterAll(() => {
|
|
process.env.NODE_ENV = OLD_NODE_ENV;
|
|
});
|
|
|
|
it('exports modules correctly', () => {
|
|
expect(Object.keys(antd)).toMatchSnapshot();
|
|
});
|
|
|
|
it('should hint when import all components in dev mode', () => {
|
|
expect(warnSpy).toBeCalledWith(
|
|
'You are using a whole package of antd, please use https://www.npmjs.com/package/babel-plugin-import to reduce app bundle size.'
|
|
);
|
|
warnSpy.mockRestore();
|
|
});
|
|
});
|