From 92e9ed09e9d379b514d92bb8d377b5d3718df763 Mon Sep 17 00:00:00 2001 From: Divyanshu Singh Date: Fri, 30 Mar 2018 19:38:08 +0530 Subject: [PATCH] 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 Reviewed-By: Colin Ihrig Reviewed-By: Trivikram Kamat Reviewed-By: James M Snell --- test/parallel/test-process-setuid-setgid.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/parallel/test-process-setuid-setgid.js b/test/parallel/test-process-setuid-setgid.js index 41fef8c9c819fa..d3aac29decf0a6 100644 --- a/test/parallel/test-process-setuid-setgid.js +++ b/test/parallel/test-process-setuid-setgid.js @@ -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$/);