Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2c33819

Browse filesBrowse files
cjihrigsilverwind
authored andcommitted
test: fix tests that check error messages
20285ad changed the format of error messages throughout lib. However, the tests were not updated to reflect these changes. This commit makes those changes. PR-URL: #3727 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 7b89a3d commit 2c33819
Copy full SHA for 2c33819
Expand file treeCollapse file tree

27 files changed

+63
-63
lines changed
Open diff view settings
Collapse file

‎lib/path.js‎

Copy file name to clipboardExpand all lines: lib/path.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ posix.extname = function(path) {
566566
posix.format = function(pathObject) {
567567
if (pathObject === null || typeof pathObject !== 'object') {
568568
throw new TypeError(
569-
"Parameter 'pathObject' must be an object, not " + typeof pathObject
569+
'Parameter "pathObject" must be an object, not ' + typeof pathObject
570570
);
571571
}
572572

Collapse file

‎test/parallel/test-assert.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-assert.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,8 @@ function testBlockTypeError(method, block) {
438438
method(block);
439439
threw = false;
440440
} catch (e) {
441-
assert.equal(e.toString(), 'TypeError: block must be a function');
441+
assert.equal(e.toString(),
442+
'TypeError: "block" argument must be a function');
442443
}
443444

444445
assert.ok(threw);
Collapse file

‎test/parallel/test-buffer.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-buffer.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,11 +1222,11 @@ assert.throws(function() {
12221222

12231223
assert.throws(function() {
12241224
new Buffer();
1225-
}, /must start with number, buffer, array or string/);
1225+
}, /Must start with number, buffer, array or string/);
12261226

12271227
assert.throws(function() {
12281228
new Buffer(null);
1229-
}, /must start with number, buffer, array or string/);
1229+
}, /Must start with number, buffer, array or string/);
12301230

12311231

12321232
// Test prototype getters don't throw
Collapse file

‎test/parallel/test-child-process-spawn-typeerror.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-spawn-typeerror.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const common = require('../common');
88
const cmd = common.isWindows ? 'rundll32' : 'ls';
99
const invalidcmd = 'hopefully_you_dont_have_this_on_your_machine';
1010
const invalidArgsMsg = /Incorrect value of args option/;
11-
const invalidOptionsMsg = /options argument must be an object/;
11+
const invalidOptionsMsg = /"options" argument must be an object/;
1212
const empty = common.fixturesDir + '/empty.js';
1313

1414
assert.throws(function() {
Collapse file

‎test/parallel/test-file-write-stream3.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-file-write-stream3.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ function run_test_4() {
178178
function() {
179179
file = fs.createWriteStream(filepath, options);
180180
},
181-
/start must be/
181+
/"start" must be/
182182
);
183183

184184
}
Collapse file

‎test/parallel/test-fs-access.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-access.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ assert.throws(function() {
9696

9797
assert.throws(function() {
9898
fs.access(__filename, fs.F_OK);
99-
}, /callback must be a function/);
99+
}, /"callback" argument must be a function/);
100100

101101
assert.throws(function() {
102102
fs.access(__filename, fs.F_OK, {});
103-
}, /callback must be a function/);
103+
}, /"callback" argument must be a function/);
104104

105105
assert.doesNotThrow(function() {
106106
fs.accessSync(__filename);
Collapse file

‎test/parallel/test-fs-null-bytes.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-null-bytes.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var assert = require('assert');
44
var fs = require('fs');
55

66
function check(async, sync) {
7-
var expected = /Path must be a string without null bytes./;
7+
var expected = /Path must be a string without null bytes/;
88
var argsSync = Array.prototype.slice.call(arguments, 2);
99
var argsAsync = argsSync.concat(function(er) {
1010
assert(er && er.message.match(expected));
Collapse file

‎test/parallel/test-fs-read-buffer-tostring-fail.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-read-buffer-tostring-fail.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ stream.on('finish', common.mustCall(function() {
2929
fd = fs.openSync(file, 'r');
3030
fs.read(fd, kStringMaxLength + 1, 0, 'utf8', common.mustCall(function(err) {
3131
assert.ok(err instanceof Error);
32-
assert.strictEqual('toString failed', err.message);
32+
assert.strictEqual('"toString()" failed', err.message);
3333
}));
3434
}));
3535

Collapse file

‎test/parallel/test-fs-read-stream-inherit.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-read-stream-inherit.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ file6.on('end', function() {
114114

115115
assert.throws(function() {
116116
fs.createReadStream(rangeFile, Object.create({start: 10, end: 2}));
117-
}, /start must be <= end/);
117+
}, /"start" option must be <= "end" option/);
118118

119119
var stream = fs.createReadStream(rangeFile, Object.create({ start: 0,
120120
end: 0 }));
Collapse file

‎test/parallel/test-fs-read-stream-throw-type-error.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-read-stream-throw-type-error.js
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ assert.doesNotThrow(function() {
1818

1919
assert.throws(function() {
2020
fs.createReadStream(example, null);
21-
}, /options must be a string or an object/);
21+
}, /"options" argument must be a string or an object/);
2222
assert.throws(function() {
2323
fs.createReadStream(example, 123);
24-
}, /options must be a string or an object/);
24+
}, /"options" argument must be a string or an object/);
2525
assert.throws(function() {
2626
fs.createReadStream(example, 0);
27-
}, /options must be a string or an object/);
27+
}, /"options" argument must be a string or an object/);
2828
assert.throws(function() {
2929
fs.createReadStream(example, true);
30-
}, /options must be a string or an object/);
30+
}, /"options" argument must be a string or an object/);
3131
assert.throws(function() {
3232
fs.createReadStream(example, false);
33-
}, /options must be a string or an object/);
33+
}, /"options" argument must be a string or an object/);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.