Skip to content

Commit

Permalink
test: update transition #5023
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjinzhou committed Dec 17, 2021
1 parent ae9ab9c commit 4706675
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion components/_util/transition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 4706675

Please sign in to comment.