-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: running vitest with
--related --watch
reruns non-affected tes…
…ts if they were changed during a run (#3844)
- Loading branch information
1 parent
2e5847e
commit c9aeac4
Showing
15 changed files
with
147 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { test } from 'vitest' | ||
import { resolve } from 'pathe' | ||
import { editFile, runVitestCli } from '../../test-utils' | ||
|
||
const cliArgs = ['--root', 'fixtures', '--watch', '--changed'] | ||
|
||
test('when nothing is changed, run nothing but keep watching', async () => { | ||
const vitest = await runVitestCli(...cliArgs) | ||
|
||
await vitest.waitForStdout('No affected test files found') | ||
await vitest.waitForStdout('Waiting for file changes...') | ||
|
||
editFile(resolve(__dirname, '../fixtures/math.ts'), content => `${content}\n\n`) | ||
|
||
await vitest.waitForStdout('RERUN ../math.ts') | ||
await vitest.waitForStdout('1 passed') | ||
|
||
editFile(resolve(__dirname, '../fixtures/math.test.ts'), content => `${content}\n\n`) | ||
|
||
await vitest.waitForStdout('RERUN ../math.test.ts') | ||
await vitest.waitForStdout('1 passed') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.