Skip to content

Commit

Permalink
feat: new getRunningMode utils
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Mar 17, 2022
1 parent 210bc6f commit 3d6c41a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/vitest/src/index.ts
Expand Up @@ -9,6 +9,7 @@ export { runOnce, isFirstRun } from './integrations/run-once'
export * from './integrations/chai'
export * from './integrations/jest-mock'
export * from './integrations/vi'
export * from './integrations/utils'

export * from './types'
export * from './api/types'
Expand Down
7 changes: 7 additions & 0 deletions packages/vitest/src/integrations/utils.ts
@@ -0,0 +1,7 @@
export function getRunningMode() {
return process.env.VITEST_MODE === 'WATCH' ? 'watch' : 'run'
}

export function isWatchMode() {
return getRunningMode() === 'watch'
}

0 comments on commit 3d6c41a

Please sign in to comment.