test: test process.setuid for bad argument types

Test process.setuid with an object as an argument. An equivalent test
exists for process.seteuid.

PR-URL: https://github.com/nodejs/node/pull/19703
Fixes: https://github.com/nodejs/node/issues/19591
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Divyanshu Singh 2018-03-30 19:38:08 +05:30 committed by Luigi Pinca
parent 8271215118
commit 83444b7c66

View File

@ -33,6 +33,10 @@ if (common.isWindows) {
return;
}
assert.throws(() => {
process.setuid({});
}, /^TypeError: setuid argument must be a number or a string$/);
assert.throws(() => {
process.setuid('fhqwhgadshgnsdhjsdbkhsdabkfabkveybvf');
}, /^Error: setuid user id does not exist$/);