mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
remove bundle size warning in test env (#10363)
This commit is contained in:
parent
f09c799bba
commit
97c2d58d15
@ -5,11 +5,4 @@ describe('antd', () => {
|
|||||||
it('exports modules correctly', () => {
|
it('exports modules correctly', () => {
|
||||||
expect(Object.keys(antd)).toMatchSnapshot();
|
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();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// this file is not used if use https://github.com/ant-design/babel-plugin-import
|
// this file is not used if use https://github.com/ant-design/babel-plugin-import
|
||||||
const ENV = process.env.NODE_ENV;
|
const ENV = process.env.NODE_ENV;
|
||||||
if (ENV !== 'production' &&
|
if (ENV !== 'production' &&
|
||||||
|
ENV !== 'test' &&
|
||||||
typeof console !== 'undefined' &&
|
typeof console !== 'undefined' &&
|
||||||
console.warn &&
|
console.warn &&
|
||||||
typeof window !== 'undefined') {
|
typeof window !== 'undefined') {
|
||||||
|
Loading…
Reference in New Issue
Block a user