remove bundle size warning in test env (#10363)

This commit is contained in:
Andreas Cederström 2018-05-14 11:13:27 +02:00 committed by 偏右
parent f09c799bba
commit 97c2d58d15
2 changed files with 1 additions and 7 deletions

View File

@ -5,11 +5,4 @@ describe('antd', () => {
it('exports modules correctly', () => {
expect(Object.keys(antd)).toMatchSnapshot();
});
it('should hint when import all components', () => {
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();
});
});

View File

@ -2,6 +2,7 @@
// this file is not used if use https://github.com/ant-design/babel-plugin-import
const ENV = process.env.NODE_ENV;
if (ENV !== 'production' &&
ENV !== 'test' &&
typeof console !== 'undefined' &&
console.warn &&
typeof window !== 'undefined') {