From f5e3cfe5f4107c31f06de069bf12af881d0b4612 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 This ensures that process.umask() throws with the correct error when invalid inputs are supplied. --- 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 6c54f1139c7086..1ac32cb7018906 100644 --- a/test/parallel/test-umask.js +++ b/test/parallel/test-umask.js @@ -40,3 +40,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/);