Vitest version 0.19.1 is fine with this, However after upgrading to 0.20.3 when mount from "@vue/test-utils": "^2.0.2",
causes the following error
FAIL src/components/HelloWorld.test.ts [ src/components/HelloWorld.test.ts ]
SyntaxError: Named export 'BaseTransition' not found. The requested module 'vue' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'vue';
const { transformVNodeArgs, Transition, BaseTransition, defineComponent, h, TransitionGroup, Teleport, nextTick, setDevtoolsHook, shallowReactive, reactive, isRef, createApp, computed } = pkg;
Reproduction
Create a new vite project, install viteest 0.20.3 and @vue/test-utils any version.
Describe the bug
Vitest version
0.19.1
is fine with this, However after upgrading to0.20.3
when mount from"@vue/test-utils": "^2.0.2",
causes the following errorReproduction
Create a new vite project, install viteest 0.20.3 and @vue/test-utils any version.
Then create a new test file with the following
This will cause the error.
Revert vitest to 0.19.1 and its working as expected.
System Info
Used Package Manager
npm
Validations