Splitting tests based on file suffix or best practice #5557
Answered
by
AriPerkkio
joaomarcelofm
asked this question in
Q&A
-
Hey all! I'm looking into split the tests we run with Vitest based on the file suffix, something like:
Based on the documentation, I could achieve the second option by changing the |
Beta Was this translation helpful? Give feedback.
Answered by
AriPerkkio
Apr 17, 2024
Replies: 1 comment 2 replies
-
I would recommend to use workspaces: import { defineWorkspace } from 'vitest/config';
export default defineWorkspace([
{
test: {
name: 'unit',
include: ['**/*.unit.test.ts'],
},
},
{
test: {
name: 'integration',
include: ['**/*.integration.test.ts'],
// More integration test related setup here...
},
},
]); You can also create two separate configuration files and pass it as |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
joaomarcelofm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would recommend to use workspaces:
You can also create two separate configuration files and pass it as
vitest --config ./path/to/vitest.config.ts
.