Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/vitest/src/node/config/resolveConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ export function resolveTestConfig(
// Coverage is shared by reference: each project's setup/test/config files are
// appended to the same exclude list below, keeping them out of the report.
if (globalConfig) {
resolved.watch = globalConfig.watch
resolved.coverage = globalConfig.coverage
resolved.attachmentsDir = globalConfig.attachmentsDir
resolved.mergeReportsLabel = globalConfig.mergeReportsLabel
Expand Down
18 changes: 18 additions & 0 deletions test/e2e/test/override.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@ async function config(
return config.test as ResolvedConfig & { $viteConfig: ResolvedViteConfig }
}

it.each([false, true])('projects follow the root watch mode (%s)', async (watch) => {
const c = await config({
$cliOptions: { watch },
projects: [true, false].map((extendsRoot) => ({
extends: extendsRoot,
test: { name: String(extendsRoot) },
plugins: [{ name: 'project-watch', config: () => ({ test: { watch: !watch } }) }],
})),
})

expect(c.watch).toBe(watch)
expect(c.resolvedProjects.map(({ projectConfig }) => projectConfig.watch)).toEqual([watch, watch])
expect(c.resolvedProjects.map(({ projectConfig }) => projectConfig.maxWorkers)).toEqual([
c.maxWorkers,
c.maxWorkers,
])
})

describe('correctly defines api flag', () => {
it('CLI overrides disabling api', async () => {
const c = await config({
Expand Down
Loading