Skip to content

Commit

Permalink
fix(Mocha Isolated): Ensure single process on single test
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Oct 11, 2022
1 parent a29cdb8 commit 7347b12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/mocha-isolated.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ if (!paths.length) {
const processesCount = (() => {
if (!argv['skip-fs-cleanup-check']) return 1;
const forced = Number(argv.w);
if (forced > 0) return forced;
return Math.max(require('os').cpus().length - 1, 1);
if (forced > 0) return Math.min(forced, paths.length);
return Math.min(Math.max(require('os').cpus().length - 1, 1), paths.length);
})();

const isMultiProcessRun = processesCount > 1;
Expand Down

0 comments on commit 7347b12

Please sign in to comment.