diff options
Diffstat (limited to 'test/parallel/test-fs-readlink-type-check.js')
-rw-r--r-- | test/parallel/test-fs-readlink-type-check.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/parallel/test-fs-readlink-type-check.js b/test/parallel/test-fs-readlink-type-check.js new file mode 100644 index 0000000000..914c1e55af --- /dev/null +++ b/test/parallel/test-fs-readlink-type-check.js @@ -0,0 +1,21 @@ +'use strict'; + +const common = require('../common'); +const fs = require('fs'); + +[false, 1, {}, [], null, undefined].forEach((i) => { + common.expectsError( + () => fs.readlink(i, common.mustNotCall()), + { + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError + } + ); + common.expectsError( + () => fs.readlinkSync(i), + { + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError + } + ); +}); |