summaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-utimes.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-03-19 14:17:50 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2018-03-25 01:45:40 +0100
commitacc3c770e7717673ee87fa37076fc50fcb91e4ea (patch)
tree278e9535d850eb1ae97d0dfd2bfefca3408d3a77 /test/parallel/test-fs-utimes.js
parent058e7fb8e66cafae700c5cb437d08572150fa69f (diff)
downloadandroid-node-v8-acc3c770e7717673ee87fa37076fc50fcb91e4ea.tar.gz
android-node-v8-acc3c770e7717673ee87fa37076fc50fcb91e4ea.tar.bz2
android-node-v8-acc3c770e7717673ee87fa37076fc50fcb91e4ea.zip
fs: fix error handling
Right now there are multiple cases where the validated entry would not be returned or a wrong error is thrown. This fixes both cases. PR-URL: https://github.com/nodejs/node/pull/19445 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'test/parallel/test-fs-utimes.js')
-rw-r--r--test/parallel/test-fs-utimes.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/parallel/test-fs-utimes.js b/test/parallel/test-fs-utimes.js
index be2d1d24df..bad9067864 100644
--- a/test/parallel/test-fs-utimes.js
+++ b/test/parallel/test-fs-utimes.js
@@ -101,8 +101,10 @@ function testIt(atime, mtime, callback) {
common.expectsError(
() => fs.futimesSync(-1, atime, mtime),
{
- code: 'ERR_INVALID_ARG_TYPE',
- type: TypeError
+ code: 'ERR_OUT_OF_RANGE',
+ type: RangeError,
+ message: 'The value of "fd" is out of range. ' +
+ 'It must be >= 0 && < 4294967296. Received -1'
}
);
tests_run++;
@@ -130,8 +132,10 @@ function testIt(atime, mtime, callback) {
common.expectsError(
() => fs.futimes(-1, atime, mtime, common.mustNotCall()),
{
- code: 'ERR_INVALID_ARG_TYPE',
- type: TypeError,
+ code: 'ERR_OUT_OF_RANGE',
+ type: RangeError,
+ message: 'The value of "fd" is out of range. ' +
+ 'It must be >= 0 && < 4294967296. Received -1'
}
);