From 5e09a3d4eddad7971a17ebe5398c8c7ce9c71139 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 e0db8ee00222dd..54341b8564f242 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$/);