Skip to content

Commit 45ee049

Browse files
committed
test: expand test case for unknown file open flags
1 parent a255da4 commit 45ee049

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/parallel/test-fs-open-flags.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,18 @@ assert.equal(fs._stringToFlags('xa+'), O_APPEND | O_CREAT | O_RDWR | O_EXCL);
3434
.forEach(function(flags) {
3535
assert.throws(function() { fs._stringToFlags(flags); });
3636
});
37+
38+
assert.throws(
39+
() => fs._stringToFlags({}),
40+
/Unknown file open flag: \[object Object\]/
41+
);
42+
43+
assert.throws(
44+
() => fs._stringToFlags(true),
45+
/Unknown file open flag: true/
46+
);
47+
48+
assert.throws(
49+
() => fs._stringToFlags(null),
50+
/Unknown file open flag: null/
51+
);

0 commit comments

Comments
 (0)