Skip to content

Commit

Permalink
fix: don't use disposed mocha instance to query parallel mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartones authored and Diego Muñoz Pérez committed Jun 4, 2024
1 parent 55d042e commit 24aaa00
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/cli/watch-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,14 @@ const createRerunner = (mocha, watcher, {beforeRun} = {}) => {
// running.
let runner = null;

const blastFullCache = !mocha.options.parallel;

// true if a file has changed during a test run
let rerunScheduled = false;

const run = async () => {
try {
mocha = beforeRun ? (await beforeRun({mocha, watcher})) || mocha : mocha;
const blastFullCache = !mocha.options.parallel;
runner = mocha.run(() => {
debug('finished watch run');
runner = null;
Expand Down

0 comments on commit 24aaa00

Please sign in to comment.