We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7af2c57 commit 2f717d9Copy full SHA for 2f717d9
1 file changed
test/threads_test.js
@@ -4,9 +4,7 @@ const assert = require('assert').strict;
4
const os = require('os');
5
const getThreads = require('../lib/getThreads.js');
6
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;
+const THREADS = Math.max(os.cpus().length - 1, 1);
10
11
describe('getThreads', () => {
12
it('should use the number of available threads -1', done => {
@@ -30,6 +28,7 @@ describe('getThreads', () => {
30
28
config.threads = option;
31
29
const expected = 1;
32
const actual = getThreads(config);
+
33
assert.equal(actual, expected);
34
}
35
0 commit comments