-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(browser): isolate browser tests #3584
Conversation
chore: use settimeout promise in vue example async test
# Conflicts: # packages/ui/client/auto-imports.d.ts # packages/vitest/src/node/pools/browser.ts # pnpm-lock.yaml
✅ Deploy Preview for fastidious-cascaron-4ded94 canceled.
|
# Conflicts: # packages/browser/src/client/main.ts # pnpm-lock.yaml
@userquin can you resolve conflicts last time? |
examples/vue/test/as-async.test.ts
Outdated
await flushPromises() // start loading, so vitest started loading | ||
await vi.dynamicImportSettled() | ||
// await flushPromises() // start loading, so vitest started loading | ||
// await vi.dynamicImportSettled() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dynamicImportSettled
is supported in browser tests
* | ||
* @default false | ||
*/ | ||
enableUI?: boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the use case when you run it in the browser without a UI is not so popular. @vitest/browser
is primarily to allow component testing. examples/browser is just a test to make sure everything works seamlessly
Sure |
# Conflicts: # packages/browser/package.json # packages/browser/src/client/main.ts # packages/browser/src/client/vite.config.ts # packages/browser/src/node/index.ts # packages/vitest/src/node/core.ts # packages/vitest/src/node/pools/browser.ts # pnpm-lock.yaml
Closes #3154 |
Looks like an awesome feature! |
Is the browser UI tab still a planned addition after #5036? 🤞🙏 |
Seems like this PR also fixes another issue. |
This PR isolates tests creating an iframe per test file.
On my local tests, I need to start the tests a few times to get it working, I have added vue and react examples and vue should also work (this is one we need to revert changes).
DRAFT: we'll need to revert some changes in existing tests and cleanup some modules.