Skip to content
Permalink
Browse files

test: expand test case for unknown file open flags

PR-URL: #5590
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information...
jasnell committed Mar 7, 2016
1 parent 8bb60e3 commit a5aa7c17138ba811324526c1178f6a5b4a094acb
Showing with 15 additions and 0 deletions.
  1. +15 −0 test/parallel/test-fs-open-flags.js
@@ -34,3 +34,18 @@ assert.equal(fs._stringToFlags('xa+'), O_APPEND | O_CREAT | O_RDWR | O_EXCL);
.forEach(function(flags) {
assert.throws(function() { fs._stringToFlags(flags); });
});

assert.throws(
() => fs._stringToFlags({}),
/Unknown file open flag: \[object Object\]/
);

assert.throws(
() => fs._stringToFlags(true),
/Unknown file open flag: true/
);

assert.throws(
() => fs._stringToFlags(null),
/Unknown file open flag: null/
);

0 comments on commit a5aa7c1

Please sign in to comment.
You can’t perform that action at this time.