From 47066753ac2dab47806584e8f90950cf5958c95e Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Fri, 17 Dec 2021 16:23:11 +0800 Subject: [PATCH] test: update transition #5023 --- components/_util/transition.tsx | 7 ++++++- package.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/_util/transition.tsx b/components/_util/transition.tsx index c943b7d40b..2a118849e0 100644 --- a/components/_util/transition.tsx +++ b/components/_util/transition.tsx @@ -58,12 +58,17 @@ export const getTransitionGroupProps = (transitionName: string, opt: TransitionP let Transition = T; let TransitionGroup = TG; -if (process.env.JUST_ANTDV_ENV === 'test') { +if (process.env.NODE_ENV === 'test') { + let warn = true; Transition = defineComponent({ name: 'TransitionForTest', inheritAttrs: false, setup(_props, { slots, attrs }) { const instance = getCurrentInstance(); + if (warn) { + console.warn('application runing at test env, you should build use production env'); + warn = false; + } onUpdated(() => { const child = instance.subTree.children[0]; if (child && child.dirs && child.dirs[0]) { diff --git a/package.json b/package.json index 58490882ee..dd50cf2618 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "scripts": { "predev": "node node_modules/esbuild/install.js", "dev": "yarn predev && yarn routes && vite serve site", - "test": "cross-env NODE_ENV=test JUST_ANTDV_ENV=test jest --config .jest.js", + "test": "cross-env NODE_ENV=test jest --config .jest.js", "compile": "node antd-tools/cli/run.js compile", "generator-webtypes": "tsc -p antd-tools/generator-types/tsconfig.json && node antd-tools/generator-types/index.js", "pub": "node --max_old_space_size=8192 antd-tools/cli/run.js pub",