Skip to content

Commit

Permalink
all valid Node.js versions have --watch support
Browse files Browse the repository at this point in the history
  • Loading branch information
ChALkeR committed Jul 16, 2024
1 parent bc17b58 commit bc42764
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 2 additions & 5 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { basename, dirname, resolve } from 'node:path'
import { createRequire } from 'node:module'
import assert from 'node:assert/strict'
import glob from 'fast-glob'
import { haveModuleMocks, haveSnapshots, haveForceExit, haveWatch } from '../src/version.js'
import { haveModuleMocks, haveSnapshots, haveForceExit } from '../src/version.js'

const bindir = dirname(fileURLToPath(import.meta.url))

Expand Down Expand Up @@ -119,10 +119,7 @@ if (options.forceExit) {
args.push('--test-force-exit')
}

if (options.watch) {
assert(haveWatch, 'For watch mode, use Node.js >= 18.13.0')
args.push('--watch')
}
if (options.watch) args.push('--watch')

args.push('--expose-internals') // this is unoptimal and hopefully temporary, see rationale in src/dark.cjs

Expand Down
1 change: 0 additions & 1 deletion src/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ export { major, minor, patch }
export const haveModuleMocks = (major === 22 && minor >= 3) || major > 22
export const haveSnapshots = (major === 22 && minor >= 3) || major > 22
export const haveForceExit = (major === 20 && minor > 13) || major >= 22
export const haveWatch = (major === 18 && minor > 13) || major >= 20
export const haveValidTimers = (major === 20 && minor >= 11) || major >= 22 // older glitch in various ways / stop executing
export const haveNoTimerInfiniteLoopBug = (major === 20 && minor >= 11) || major >= 22 // mock.timers.runAll() can get into infinite recursion

0 comments on commit bc42764

Please sign in to comment.