reformat code and allow negative values for threads
This commit is contained in:
parent
bcb5b28954
commit
31996935e6
8 changed files with 37 additions and 27 deletions
5
lib/util.test.js
generated
5
lib/util.test.js
generated
|
|
@ -42,7 +42,8 @@ ava_1.default('getThreadsFlag() should return the correct --threads flag', t =>
|
|||
const tests = {
|
||||
"0": "--threads=0",
|
||||
"1": "--threads=1",
|
||||
[`${numCpus + 1}`]: `--threads=${numCpus}`
|
||||
[`${numCpus + 1}`]: `--threads=${numCpus}`,
|
||||
[`${-numCpus - 1}`]: `--threads=${-numCpus}`
|
||||
};
|
||||
for (const [input, expectedFlag] of Object.entries(tests)) {
|
||||
process.env['INPUT_THREADS'] = input;
|
||||
|
|
@ -51,7 +52,7 @@ ava_1.default('getThreadsFlag() should return the correct --threads flag', t =>
|
|||
}
|
||||
});
|
||||
ava_1.default('getThreadsFlag() throws if the ram input is < 0 or NaN', t => {
|
||||
for (const input of ["-1", "hello!"]) {
|
||||
for (const input of ["hello!"]) {
|
||||
process.env['INPUT_THREADS'] = input;
|
||||
t.throws(util.getThreadsFlag);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue