Skip to content

Commit 3807c07

Browse files
committedSep 4, 2022
fix: don't fail on running vitest dev (closes #1971)
1 parent c8afc01 commit 3807c07

File tree

1 file changed

+8
-3
lines changed
  • packages/vitest/src/node

1 file changed

+8
-3
lines changed
 

‎packages/vitest/src/node/cli.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,19 @@ cli
5555

5656
cli
5757
.command('watch [...filters]')
58-
.action(start)
58+
.action(watch)
5959

6060
cli
6161
.command('dev [...filters]')
62-
.action(start)
62+
.action(watch)
6363

6464
cli
6565
.command('bench [...filters]')
6666
.action(benchmark)
6767

6868
cli
6969
.command('[...filters]')
70-
.action((filter, options) => start('test', filter, options))
70+
.action(watch)
7171

7272
cli.parse()
7373

@@ -77,6 +77,11 @@ async function runRelated(relatedFiles: string[] | string, argv: CliOptions) {
7777
await start('test', [], argv)
7878
}
7979

80+
async function watch(cliFilters: string[], options: CliOptions) {
81+
options.watch = true
82+
await start('test', cliFilters, options)
83+
}
84+
8085
async function run(cliFilters: string[], options: CliOptions) {
8186
options.run = true
8287
await start('test', cliFilters, options)

0 commit comments

Comments
 (0)
Please sign in to comment.