Skip to content

Commit 1fe3e86

Browse files
evanlucasMylesBorins
authored andcommitted
test: improve coverage for process.umask
This ensures that process.umask() throws with the correct error when invalid inputs are supplied. PR-URL: #16188 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
1 parent 0689ea6 commit 1fe3e86

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/parallel/test-umask.js

+8
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,11 @@ assert.strictEqual(parseInt(mask, 8), process.umask(old));
1919
assert.strictEqual(old, process.umask());
2020
// 2. If the test fails, process.umask() will return 0
2121
assert.strictEqual(old, process.umask());
22+
23+
assert.throws(() => {
24+
process.umask({});
25+
}, /argument must be an integer or octal string/);
26+
27+
assert.throws(() => {
28+
process.umask('123x');
29+
}, /invalid octal string/);

0 commit comments

Comments
 (0)