Selecting Internal Config File when Running in Workspace? #6280
-
Hello! 😄 Please consider the following mono-repo structure:
The
The
The This works wonderfully when running But this being a mono-repo, during merge requests, I want to run BOTH kinds of tests, from the root and using the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Would be great to get a reproducible project for this to try different solutions but here are couple ideas:
export default [
'src/*/vitest.config.unit.ts',
'src/*/vitest.config.integration.ts'
]
import { defineWorkspace } from 'vitest/config'
// Generating this could be automated with `node:fs`
export default defineWorkspace([
{
test: {
name: 'Project A Unit',
config: './src/projectA/vitest.config.unit.ts',
},
},
{
test: {
name: 'Project A Integration',
config: './src/projectA/vitest.config.integration.ts',
},
},
{
test: {
name: 'Project B Unit',
config: './src/projectB/vitest.config.unit.ts',
},
},
{
test: {
name: 'Project B Integration',
config: './src/projectB/vitest.config.integration.ts',
},
},
]) |
Beta Was this translation helpful? Give feedback.
Something like this should work. Though your repo doesn't have
vitest.config.ts
for the workspace.As the project is curr…