Skip to content

Commit b624fae

Browse files
hi-ogawaclaude
andauthored
fix: propagate experimental CLI options to child projects (#9531)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 381da4a commit b624fae

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

packages/vitest/src/node/plugins/workspace.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ export function WorkspaceVitestPlugin(
112112
if (testConfig.experimental?.nodeLoader == null && project.vitest.config.experimental?.nodeLoader != null) {
113113
vitestConfig.experimental.nodeLoader = project.vitest.config.experimental.nodeLoader
114114
}
115+
if (testConfig.experimental?.importDurations == null && project.vitest.config.experimental?.importDurations != null) {
116+
vitestConfig.experimental.importDurations = project.vitest.config.experimental.importDurations
117+
}
115118

116119
return {
117120
base: '/',

test/config/test/cli-config.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ it('correctly inherit from the cli', async () => {
3131
testNamePattern: 'math',
3232
passWithNoTests: true,
3333
bail: 100,
34+
experimental: {
35+
importDurations: {
36+
print: true,
37+
},
38+
},
3439
},
3540
})
3641
const project = ctx!.projects[0]
@@ -48,6 +53,12 @@ it('correctly inherit from the cli', async () => {
4853
retry: 6,
4954
passWithNoTests: true,
5055
bail: 100,
56+
experimental: expect.objectContaining({
57+
importDurations: {
58+
print: true,
59+
limit: 10,
60+
},
61+
}),
5162
})
5263
expect(config.testNamePattern?.test('math')).toBe(true)
5364
})

0 commit comments

Comments
 (0)