Skip to content

Commit

Permalink
squash: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
danbev committed Apr 10, 2018
1 parent 3791b37 commit 4768a54
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions test/parallel/test-child-process-spawnsync-validation-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,9 @@ const spawnSync = require('child_process').spawnSync;
const signals = process.binding('constants').os.signals;
const rootUser = process.getuid() === 0;

let invalidArgTypeError;
let invalidArgTypeErrorCount = 62;

if (common.isWindows || rootUser) {
invalidArgTypeError =
common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError }, 42);
} else {
invalidArgTypeError =
common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError },
invalidArgTypeErrorCount);
}
const invalidArgTypeError = common.expectsError(
{ code: 'ERR_INVALID_ARG_TYPE', type: TypeError },
common.isWindows || rootUser ? 42 : 62);

const invalidRangeError =
common.expectsError({ code: 'ERR_OUT_OF_RANGE', type: RangeError }, 20);
Expand Down Expand Up @@ -79,9 +71,6 @@ if (!common.isWindows) {
fail('uid', Infinity, invalidArgTypeError);
fail('uid', 3.1, invalidArgTypeError);
fail('uid', -3.1, invalidArgTypeError);
} else {
// Decrement invalidArgTypeErrorCount if validation isn't possible
invalidArgTypeErrorCount -= 10;
}
}

Expand All @@ -101,9 +90,6 @@ if (!common.isWindows) {
fail('gid', Infinity, invalidArgTypeError);
fail('gid', 3.1, invalidArgTypeError);
fail('gid', -3.1, invalidArgTypeError);
} else {
// Decrement invalidArgTypeErrorCount if validation isn't possible
invalidArgTypeErrorCount -= 10;
}
}
}
Expand Down

0 comments on commit 4768a54

Please sign in to comment.