Replies: 3 comments
-
|
I saw in the documentation that the |
Beta Was this translation helpful? Give feedback.
This comment was marked as spam.
This comment was marked as spam.
-
|
The API you want is import { vi } from 'vitest'
import { flushPromises, mount } from '@vue/test-utils'
it('renders', async () => {
mount(CompA)
await vi.dynamicImportSettled()
await flushPromises()
// assertions
})That waits for |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
Since migrating to Vitest 4, I've been experiencing test errors that worked fine with Vitest 3.
In version 4.0, I was getting the error "Error: [vitest-worker]: Closing rpc while "fetch" was pending," and since version 4.1, I'm getting the error "EnvironmentTeardownError: Cannot load ..."
Unable to pinpoint the problem with my tests, I created a small project from scratch where I'm reproducing the issue with a minimal dynamic import scenario.
Here is the repo link
NOTE: I replaced the initial tsconfig with the contents of tsconfig.vitest.json. I don't know why, but if I don't do that, I don't catch anything with onUnhandledError.
Is there something misconfigured in my setup? (I started a new project using the command
npm create vue@latest)Thank you so much for your help.
Reproduction
1 - Clone the repo
2 - npm install
3 - npx vitest run --no-file-parallelism CompA
System Info
System: OS: macOS 26.3.1 CPU: (12) arm64 Apple M4 Pro Memory: 85.34 MB / 24.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.22.0 - /Users/ygradaive/.nvm/versions/node/v22.22.0/bin/node npm: 10.9.4 - /Users/ygradaive/.nvm/versions/node/v22.22.0/bin/npm Browsers: Chrome: 145.0.7632.160 Firefox: 148.0.2 Firefox Developer Edition: 149.0 Safari: 26.3.1 npmPackages: @vitejs/plugin-vue: ^6.0.3 => 6.0.5 @vitest/coverage-v8: ^4.0.18 => 4.1.0 @vitest/eslint-plugin: ^1.6.6 => 1.6.11 @vitest/ui: ^4.0.18 => 4.1.0 vite: ^7.3.1 => 7.3.1 vitest: ^4.0.18 => 4.1.0 vitest-sonar-reporter: ^3.0.0 => 3.0.0Used Package Manager
npm
Validations
Beta Was this translation helpful? Give feedback.
All reactions