-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(watch): don't indicate exit when no matching files
- Loading branch information
1 parent
fecc56a
commit b82e5ea
Showing
4 changed files
with
55 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
import { expect, it } from 'vitest' | ||
import { runVitest } from '../../test-utils' | ||
|
||
it('vitest doesnt fail when running empty files', async () => { | ||
const { exitCode } = await runVitest({ | ||
it('vitest doesnt fail when running empty files {passWithNoTests: true}', async () => { | ||
const { exitCode, stdout } = await runVitest({ | ||
root: './fixtures/pass-empty-files', | ||
passWithNoTests: true, | ||
}) | ||
expect(exitCode).toBe(0) | ||
expect(stdout).toMatch('no tests') | ||
}) | ||
|
||
it('vitest fails when running empty files {passWithNoTests: false}', async () => { | ||
const { exitCode, stderr } = await runVitest({ | ||
root: './fixtures/pass-empty-files', | ||
passWithNoTests: false, | ||
}) | ||
|
||
expect(exitCode).toBe(1) | ||
expect(stderr).toMatch('Error: No test suite found in file') | ||
}) |