From 8e04c55fa75cc2c8d68fff6972629a9d003fe0d1 Mon Sep 17 00:00:00 2001 From: Evan Lucas Date: Fri, 13 Oct 2017 13:15:06 -0500 Subject: [PATCH] test: improve coverage for process.umask MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This ensures that process.umask() throws with the correct error when invalid inputs are supplied. PR-URL: https://github.com/nodejs/node/pull/16188 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Tobias Nießen Reviewed-By: Jeremiah Senkpiel Reviewed-By: Yuta Hiroto Reviewed-By: Gireesh Punathil --- test/parallel/test-umask.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/parallel/test-umask.js b/test/parallel/test-umask.js index 7e4827a4cfc47d..b190dfe024cb21 100644 --- a/test/parallel/test-umask.js +++ b/test/parallel/test-umask.js @@ -19,3 +19,11 @@ assert.strictEqual(parseInt(mask, 8), process.umask(old)); assert.strictEqual(old, process.umask()); // 2. If the test fails, process.umask() will return 0 assert.strictEqual(old, process.umask()); + +assert.throws(() => { + process.umask({}); +}, /argument must be an integer or octal string/); + +assert.throws(() => { + process.umask('123x'); +}, /invalid octal string/);