Skip to content

Commit 2f717d9

Browse files
authored
Update threads_test.js too (#187)
1 parent 7af2c57 commit 2f717d9

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

test/threads_test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ const assert = require('assert').strict;
44
const os = require('os');
55
const getThreads = require('../lib/getThreads.js');
66

7-
// eslint-disable-next-line unicorn/explicit-length-check
8-
const CPUS = os.cpus() && os.cpus().length;
9-
const THREADS = CPUS > 2 ? CPUS - 1 : 1;
7+
const THREADS = Math.max(os.cpus().length - 1, 1);
108

119
describe('getThreads', () => {
1210
it('should use the number of available threads -1', done => {
@@ -30,6 +28,7 @@ describe('getThreads', () => {
3028
config.threads = option;
3129
const expected = 1;
3230
const actual = getThreads(config);
31+
3332
assert.equal(actual, expected);
3433
}
3534

0 commit comments

Comments
 (0)