diff --git a/components/__tests__/index.test.js b/components/__tests__/index.test.js index f467803b6d..d3bd211bb7 100644 --- a/components/__tests__/index.test.js +++ b/components/__tests__/index.test.js @@ -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(); - }); }); diff --git a/components/index.tsx b/components/index.tsx index 6de0b9a55d..4a06cf350e 100644 --- a/components/index.tsx +++ b/components/index.tsx @@ -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') {