Skip to content

Commit

Permalink
fix: don't fail on running vitest dev (closes #1971)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Sep 4, 2022
1 parent c8afc01 commit 3807c07
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/vitest/src/node/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,19 @@ cli

cli
.command('watch [...filters]')
.action(start)
.action(watch)

cli
.command('dev [...filters]')
.action(start)
.action(watch)

cli
.command('bench [...filters]')
.action(benchmark)

cli
.command('[...filters]')
.action((filter, options) => start('test', filter, options))
.action(watch)

cli.parse()

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

async function watch(cliFilters: string[], options: CliOptions) {
options.watch = true
await start('test', cliFilters, options)
}

async function run(cliFilters: string[], options: CliOptions) {
options.run = true
await start('test', cliFilters, options)
Expand Down

0 comments on commit 3807c07

Please sign in to comment.