GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: inherit `watch` from the root config in projects (#11724) · vitest-dev/vitest@77c122c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/vitest/src/node/config
    • resolveConfig.ts
  • test/e2e/test
    • projects.test.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/vitest/src/node/config/resolveConfig.ts‎

Copy file name to clipboardExpand all lines: packages/vitest/src/node/config/resolveConfig.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ export function resolveTestConfig(
231231
resolved.coverage = globalConfig.coverage
232232
resolved.attachmentsDir = globalConfig.attachmentsDir
233233
resolved.mergeReportsLabel = globalConfig.mergeReportsLabel
234+
resolved.watch = globalConfig.watch
234235
}
235236

236237
const rootStats = statSync(resolved.root, { throwIfNoEntry: false })
Collapse file

‎test/e2e/test/projects.test.ts‎

Copy file name to clipboardExpand all lines: test/e2e/test/projects.test.ts
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,25 @@ describe('the root config inheritance', () => {
161161
expect(ctx!.projects.map((project) => project.config.projects)).toEqual([undefined, undefined])
162162
})
163163

164+
it.for([true, false])('projects inherit watch from the root config (watch %s)', async (watch) => {
165+
const { stderr, ctx } = await runInlineTests(
166+
{
167+
'vitest.config.js': {
168+
test: {
169+
projects: [
170+
{ test: { name: 'inherited' } },
171+
{ extends: false, test: { name: 'isolated' } },
172+
],
173+
},
174+
},
175+
'basic.test.js': basicTest,
176+
},
177+
{ watch },
178+
)
179+
expect(stderr).toBe('')
180+
expect(ctx!.projects.map((project) => project.config.watch)).toEqual([watch, watch])
181+
})
182+
164183
it('the root name and globalSetup are not inherited by the projects', async () => {
165184
const { stderr, ctx, fs } = await runInlineTests({
166185
'globalSetup.js': ts`

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.