How To Make A Freelance Blog

Letter Press Business Cards

happy friday gif quotes 5189 wordsjustforyou com original blessings of love happy friday friday hello friday happy friday gifs happy friday gif 100 good morning friday images quotes fnp a pink background with hearts and flowers on it s friday wishing you a friday happy gif friday happy good discover share gifs happy friday quotes and animated gifs 100 good morning friday images wishes and quotes good morning happy friday greetings gifs tenor have a great friday gif happy friday gif cute gifsbuddy com happy friday animated pictures happy friday gif gifcen happy friday gif images with quotes 15 beautiful happy friday gif animated images friday quotes 15 beautiful happy friday gif animated images for whatsapp 15 cool animated happy friday gif images 15 beautiful happy friday gif animated images for whatsapp good morning happy friday gif quote pictures photos and images for happy friday gif images with quotes happy friday gifs 70 moving pictures with captions happy friday quotes gif happy friday gifs 70 moving pictures with captions 15 beautiful happy friday gif animated images for whatsapp 15 beautiful happy friday gif animated images friday quotes happy friday funny gif gifsbuddy com happy friday gif 100 good morning friday images quotes fnp friday quotes gif friday quotes discover share gifs happy friday gif 100 good morning friday images quotes fnp happy friday quotes gif happy friday gifs 70 moving pictures with captions 15 beautiful happy friday gif animated images friday quotes happy friday gifs 70 moving pictures with captions happy friday gifs 70 moving pictures with captions 8 happy friday gif animations happy friday quotes happy friday gifs 70 moving pictures with captions happy friday gifs 70 moving pictures with captions happy friday gifs 70 moving pictures with captions

:
Pretty Business Cards
fix: rerun tests when project's setup file is changed (Sample Natural Product Business Plan)
1 parent Wsmt In Red Font commit 0f33506

Friday happy gif friday happy good discover share gifs 3 files changed Famous Articles To Read

Lines changed: 67 additions & 2 deletions

How To Read Journal Report Letter Press Business Cards

packages/vitest/src/node/watcher.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,27 @@ export class VitestWatcher {
140140
}
141141
}
142142

143+
private handleSetupFile(filepath: string) {
144+
let isSetupFile: boolean = false
145+
146+
this.vitest.projects.forEach((project) => {
147+
if (!project.config.setupFiles.includes(filepath)) {
148+
return
149+
}
150+
151+
this.vitest.state.filesMap.forEach((files) => {
152+
files.forEach((file) => {
153+
if (file.projectName === project.name) {
154+
isSetupFile = true
155+
this.changedTests.add(file.filepath)
156+
}
157+
})
158+
})
159+
})
160+
161+
return isSetupFile
162+
}
163+
143164
/**
144165
* @returns A value indicating whether rerun is needed (changedTests was mutated)
145166
*/
@@ -153,6 +174,10 @@ export class VitestWatcher {
153174
return true
154175
}
155176

177+
if (this.handleSetupFile(filepath)) {
178+
return true
179+
}
180+
156181
const projects = this.vitest.projects.filter((project) => {
157182
const moduleGraph = project.browser?.vite.moduleGraph || project.vite.moduleGraph
158183
return moduleGraph.getModulesByFile(filepath)?.size

test/watch/test/workspaces.test.ts

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { fileURLToPath } from 'node:url'
33
import { dirname, resolve } from 'pathe'
44
import { afterAll, afterEach, expect, it } from 'vitest'
55

6-
import { runVitestCli } from '../../test-utils'
6+
import { runInlineTests, runVitestCli } from '../../test-utils'
77

88
const file = fileURLToPath(import.meta.url)
99
const dir = dirname(file)
@@ -125,3 +125,44 @@ it('adding a new test file matching project specific config triggers re-run', as
125125
expect(vitest.stdout).not.include('|node|')
126126
expect(vitest.stdout).not.include('|happy-dom|')
127127
})
128+
129+
it('editing a setup file inside the project reruns tests', async () => {
130+
const { fs, vitest } = await runInlineTests({
131+
'setupFile.js': '',
132+
'project-1/basic.test.js': `test("[p1] reruns")`,
133+
'project-2/basic.test.js': `test("[p2] doesn\'t rerun")`,
134+
'vitest.config.js': {
135+
test: {
136+
projects: [
137+
{
138+
test: {
139+
name: 'p1',
140+
include: ['./project-1/basic.test.js'],
141+
setupFiles: ['./setupFile.js'],
142+
globals: true,
143+
},
144+
},
145+
{
146+
test: {
147+
name: 'p2',
148+
include: ['./project-2/basic.test.js'],
149+
globals: true,
150+
},
151+
},
152+
],
153+
},
154+
},
155+
}, { watch: true })
156+
157+
await vitest.waitForStdout('Waiting for file changes')
158+
expect(vitest.stdout).toContain('[p1] reruns')
159+
expect(vitest.stdout).toContain('[p2] doesn\'t rerun')
160+
161+
fs.editFile('./setupFile.js', () => '// ---edit')
162+
163+
vitest.resetOutput()
164+
await vitest.waitForStdout('Test Files 1 passed')
165+
166+
expect(vitest.stdout).toContain('[p1] reruns')
167+
expect(vitest.stdout).not.toContain('[p2] doesn\'t rerun')
168+
})

test/workspaces/vitest.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export default defineConfig({
2323
globalConfigValue: true,
2424
},
2525
projects: [
26-
2726
'space_2',
2827
'./space_*/vitest.config.ts',
2928
'./space_1/*.config.ts',

Simple Business Card Maker Letter Press Cards

Comments
 (0)