GeezerVison is showing github.com — test: fix tests that check error messages · nodejs/node@2c33819
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: lib/path.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -566,7 +566,7 @@ posix.extname = function(path) { | 566 | 566 | posix.format = function(pathObject) { | 567 | 567 | if (pathObject === null || typeof pathObject !== 'object') { | 568 | 568 | throw new TypeError( | 569 | | - "Parameter 'pathObject' must be an object, not " + typeof pathObject | | 569 | + 'Parameter "pathObject" must be an object, not ' + typeof pathObject | 570 | 570 | ); | 571 | 571 | } | 572 | 572 |
| |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-assert.js +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -438,7 +438,8 @@ function testBlockTypeError(method, block) { | 438 | 438 | method(block); | 439 | 439 | threw = false; | 440 | 440 | } 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'); | 442 | 443 | } | 443 | 444 |
| 444 | 445 | assert.ok(threw); | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-buffer.js +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1222,11 +1222,11 @@ assert.throws(function() { | 1222 | 1222 |
| 1223 | 1223 | assert.throws(function() { | 1224 | 1224 | new Buffer(); | 1225 | | -}, /must start with number, buffer, array or string/); | | 1225 | +}, /Must start with number, buffer, array or string/); | 1226 | 1226 |
| 1227 | 1227 | assert.throws(function() { | 1228 | 1228 | new Buffer(null); | 1229 | | -}, /must start with number, buffer, array or string/); | | 1229 | +}, /Must start with number, buffer, array or string/); | 1230 | 1230 |
| 1231 | 1231 |
| 1232 | 1232 | // Test prototype getters don't throw | |
Collapse file 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 number | Diff line number | Diff line change |
|---|
@@ -8,7 +8,7 @@ const common = require('../common'); | 8 | 8 | const cmd = common.isWindows ? 'rundll32' : 'ls'; | 9 | 9 | const invalidcmd = 'hopefully_you_dont_have_this_on_your_machine'; | 10 | 10 | 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/; | 12 | 12 | const empty = common.fixturesDir + '/empty.js'; | 13 | 13 |
| 14 | 14 | assert.throws(function() { | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-file-write-stream3.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -178,7 +178,7 @@ function run_test_4() { | 178 | 178 | function() { | 179 | 179 | file = fs.createWriteStream(filepath, options); | 180 | 180 | }, | 181 | | - /start must be/ | | 181 | + /"start" must be/ | 182 | 182 | ); | 183 | 183 |
| 184 | 184 | } | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-fs-access.js +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -96,11 +96,11 @@ assert.throws(function() { | 96 | 96 |
| 97 | 97 | assert.throws(function() { | 98 | 98 | fs.access(__filename, fs.F_OK); | 99 | | -}, /callback must be a function/); | | 99 | +}, /"callback" argument must be a function/); | 100 | 100 |
| 101 | 101 | assert.throws(function() { | 102 | 102 | fs.access(__filename, fs.F_OK, {}); | 103 | | -}, /callback must be a function/); | | 103 | +}, /"callback" argument must be a function/); | 104 | 104 |
| 105 | 105 | assert.doesNotThrow(function() { | 106 | 106 | fs.accessSync(__filename); | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-fs-null-bytes.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,7 @@ var assert = require('assert'); | 4 | 4 | var fs = require('fs'); | 5 | 5 |
| 6 | 6 | 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/; | 8 | 8 | var argsSync = Array.prototype.slice.call(arguments, 2); | 9 | 9 | var argsAsync = argsSync.concat(function(er) { | 10 | 10 | assert(er && er.message.match(expected)); | |
Collapse file 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 number | Diff line number | Diff line change |
|---|
@@ -29,7 +29,7 @@ stream.on('finish', common.mustCall(function() { | 29 | 29 | fd = fs.openSync(file, 'r'); | 30 | 30 | fs.read(fd, kStringMaxLength + 1, 0, 'utf8', common.mustCall(function(err) { | 31 | 31 | assert.ok(err instanceof Error); | 32 | | - assert.strictEqual('toString failed', err.message); | | 32 | + assert.strictEqual('"toString()" failed', err.message); | 33 | 33 | })); | 34 | 34 | })); | 35 | 35 |
| |
Collapse file 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 number | Diff line number | Diff line change |
|---|
@@ -114,7 +114,7 @@ file6.on('end', function() { | 114 | 114 |
| 115 | 115 | assert.throws(function() { | 116 | 116 | fs.createReadStream(rangeFile, Object.create({start: 10, end: 2})); | 117 | | -}, /start must be <= end/); | | 117 | +}, /"start" option must be <= "end" option/); | 118 | 118 |
| 119 | 119 | var stream = fs.createReadStream(rangeFile, Object.create({ start: 0, | 120 | 120 | end: 0 })); | |
Collapse file 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 number | Diff line number | Diff line change |
|---|
@@ -18,16 +18,16 @@ assert.doesNotThrow(function() { | 18 | 18 |
| 19 | 19 | assert.throws(function() { | 20 | 20 | fs.createReadStream(example, null); | 21 | | -}, /options must be a string or an object/); | | 21 | +}, /"options" argument must be a string or an object/); | 22 | 22 | assert.throws(function() { | 23 | 23 | fs.createReadStream(example, 123); | 24 | | -}, /options must be a string or an object/); | | 24 | +}, /"options" argument must be a string or an object/); | 25 | 25 | assert.throws(function() { | 26 | 26 | fs.createReadStream(example, 0); | 27 | | -}, /options must be a string or an object/); | | 27 | +}, /"options" argument must be a string or an object/); | 28 | 28 | assert.throws(function() { | 29 | 29 | fs.createReadStream(example, true); | 30 | | -}, /options must be a string or an object/); | | 30 | +}, /"options" argument must be a string or an object/); | 31 | 31 | assert.throws(function() { | 32 | 32 | fs.createReadStream(example, false); | 33 | | -}, /options must be a string or an object/); | | 33 | +}, /"options" argument must be a string or an object/); |
|