summaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-fchown.js
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2017-12-13 14:24:34 -0800
committerJames M Snell <jasnell@gmail.com>2017-12-22 12:49:10 -0800
commit6100e12667429acad1827b6d918e512e55a7a6a7 (patch)
tree4fac815add3abf5d54112723798ecc78cb3e06fa /test/parallel/test-fs-fchown.js
parent92fc14a4595d460394cad8ad5a091dcc450068a5 (diff)
downloadandroid-node-v8-6100e12667429acad1827b6d918e512e55a7a6a7.tar.gz
android-node-v8-6100e12667429acad1827b6d918e512e55a7a6a7.tar.bz2
android-node-v8-6100e12667429acad1827b6d918e512e55a7a6a7.zip
fs: move type checking to js
PR-URL: https://github.com/nodejs/node/pull/17667 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'test/parallel/test-fs-fchown.js')
-rw-r--r--test/parallel/test-fs-fchown.js65
1 files changed, 6 insertions, 59 deletions
diff --git a/test/parallel/test-fs-fchown.js b/test/parallel/test-fs-fchown.js
index 2e75c6b909..8812fbbe3f 100644
--- a/test/parallel/test-fs-fchown.js
+++ b/test/parallel/test-fs-fchown.js
@@ -9,7 +9,7 @@ const fs = require('fs');
{
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(
@@ -17,7 +17,7 @@ const fs = require('fs');
{
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'
}
);
@@ -26,7 +26,7 @@ const fs = require('fs');
{
code: 'ERR_INVALID_ARG_TYPE',
type: TypeError,
- message: 'The "uid" argument must be of type number'
+ message: 'The "uid" argument must be of type integer'
}
);
common.expectsError(
@@ -34,7 +34,7 @@ const fs = require('fs');
{
code: 'ERR_INVALID_ARG_TYPE',
type: TypeError,
- message: 'The "uid" argument must be of type number'
+ message: 'The "uid" argument must be of type integer'
}
);
@@ -43,7 +43,7 @@ const fs = require('fs');
{
code: 'ERR_INVALID_ARG_TYPE',
type: TypeError,
- message: 'The "gid" argument must be of type number'
+ message: 'The "gid" argument must be of type integer'
}
);
common.expectsError(
@@ -51,60 +51,7 @@ const fs = require('fs');
{
code: 'ERR_INVALID_ARG_TYPE',
type: TypeError,
- message: 'The "gid" argument must be of type number'
+ message: 'The "gid" argument must be of type integer'
}
);
});
-
-[-1, 0xFFFFFFFF + 1].forEach((i) => {
- common.expectsError(
- () => fs.fchown(i),
- {
- code: 'ERR_OUT_OF_RANGE',
- type: RangeError,
- message: 'The "fd" argument is out of range'
- }
- );
- common.expectsError(
- () => fs.fchownSync(i),
- {
- code: 'ERR_OUT_OF_RANGE',
- type: RangeError,
- message: 'The "fd" argument is out of range'
- }
- );
-});
-
-common.expectsError(
- () => fs.fchown(1, -1),
- {
- code: 'ERR_OUT_OF_RANGE',
- type: RangeError,
- message: 'The "uid" argument is out of range'
- }
-);
-common.expectsError(
- () => fs.fchownSync(1, -1),
- {
- code: 'ERR_OUT_OF_RANGE',
- type: RangeError,
- message: 'The "uid" argument is out of range'
- }
-);
-
-common.expectsError(
- () => fs.fchown(1, 1, -1),
- {
- code: 'ERR_OUT_OF_RANGE',
- type: RangeError,
- message: 'The "gid" argument is out of range'
- }
-);
-common.expectsError(
- () => fs.fchownSync(1, 1, -1),
- {
- code: 'ERR_OUT_OF_RANGE',
- type: RangeError,
- message: 'The "gid" argument is out of range'
- }
-);