vitest
vitest copied to clipboard
Add support for `browser.instances[].fileParallelism`
Clear and concise description of the problem
I'm seeing flakiness with Firefox when running test files parallel. Turning off fileParallelism seems to work.
I have chromium in browser.instances too, that is able to run all files parallel quick and stable. Setting top-level fileParallelism: false is not ideal.
Suggested solution
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
browser: {
enabled: true,
provider: 'playwright',
instances: [
// Run all tests parallel with Chromium, it's stable
{ browser: "chromium" }, // resolves to default fileParallelism: true
// Firefox is flaky, run tests without parallelism
{ browser: "firefox", fileParallelism: false },
],
},
},
});
Alternative
Right now I'm using following script:
"scripts": {
"test": "vitest --project chromium && vitest --project firefox --no-file-parallelism"
}
Additional context
No response
Validations
- [x] Follow our Code of Conduct
- [x] Read the Contributing Guidelines.
- [x] Read the docs.
- [x] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.