From 97c2d58d15669b34e2473be30e765dff7b3e79c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Cederstr=C3=B6m?= Date: Mon, 14 May 2018 11:13:27 +0200 Subject: [PATCH] remove bundle size warning in test env (#10363) --- components/__tests__/index.test.js | 7 ------- components/index.tsx | 1 + 2 files changed, 1 insertion(+), 7 deletions(-) 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') {