-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Describe the bug
I'm in the process of migrating some tests in a project to run in browser mode. I currently have 507 tests and I started by migrating 3 of those to browser mode. I have made the following changes to my config:
Before
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./vitest.setup.js'],
watch: false,
}
After
test: {
globals: true,
watch: false,
projects: [
{
extends: true,
test: {
name: 'jsdom',
environment: 'jsdom',
setupFiles: ['./vitest.setup.js'],
include: defaultInclude,
exclude: browserInclude,
},
},
{
extends: true,
test: {
name: 'browser',
browser: {
provider: playwright(),
enabled: true,
headless: true,
instances: [{ browser: 'chromium' }],
},
include: browserInclude,
},
},
],
}
Making these changes almost doubles the time it takes to run all the tests even though the 3 browser tests run quite quickly. The browser tests are run initially and after this the jsdom tests run but much slower than usual. Locally on my computer I cannot see a significant change between these cases.
Before
Duration 284.83s (transform 3.58s, setup 121.86s, import 73.16s, tests 23.10s, environment 39.53s)
After
Duration 473.52s (transform 5.90s, setup 203.70s, import 118.68s, tests 45.82s, environment 64.73s)
I have seen some similar discussion here: #6223
Reproduction
I currently have no reproduction since the project is private and this needs a CI setup to be reproduced.
System Info
Only happens on Github ActionsUsed Package Manager
yarn
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.