diff options
Diffstat (limited to 'test/parallel/test-fs-stat.js')
-rw-r--r-- | test/parallel/test-fs-stat.js | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/test/parallel/test-fs-stat.js b/test/parallel/test-fs-stat.js index 57fccc1586..7f0f535d0c 100644 --- a/test/parallel/test-fs-stat.js +++ b/test/parallel/test-fs-stat.js @@ -137,7 +137,7 @@ fs.stat(__filename, common.mustCall(function(err, s) { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "fd" argument must be of type number' + message: 'The "fd" argument must be of type integer' } ); common.expectsError( @@ -145,26 +145,38 @@ fs.stat(__filename, common.mustCall(function(err, s) { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "fd" argument must be of type number' + message: 'The "fd" argument must be of type integer' } ); }); -[-1, 0xFFFFFFFF + 1].forEach((i) => { +[false, 1, {}, [], null, undefined].forEach((i) => { common.expectsError( - () => fs.fstat(i), + () => fs.lstat(i, common.mustNotCall()), { - code: 'ERR_OUT_OF_RANGE', - type: RangeError, - message: 'The "fd" argument is out of range' + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError } ); common.expectsError( - () => fs.fstatSync(i), + () => fs.lstatSync(i), + { + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError + } + ); + common.expectsError( + () => fs.stat(i, common.mustNotCall()), { - code: 'ERR_OUT_OF_RANGE', - type: RangeError, - message: 'The "fd" argument is out of range' + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError + } + ); + common.expectsError( + () => fs.statSync(i), + { + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError } ); }); |