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 2b8b40f

Browse filesBrowse files
BridgeARMylesBorins
authored andcommitted
test: fix a TODO and remove obsolete TODOs
This removes outdated TODOs and adds a test for invalid input in `fs.copyFile` and solves a TODO by doing so. PR-URL: #20319 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 645a97a commit 2b8b40f
Copy full SHA for 2b8b40f

File tree

Expand file treeCollapse file tree

4 files changed

+11
-18
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

4 files changed

+11
-18
lines changed
Open diff view settings
Collapse file

‎lib/url.js‎

Copy file name to clipboardExpand all lines: lib/url.js
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,6 @@ Url.prototype.parse = function parse(url, parseQueryString, slashesDenoteHost) {
281281
// http://a@b@c/ => user:a@b host:c
282282
// http://a@b?@c => user:a host:b path:/?@c
283283

284-
// v0.12 TODO(isaacs): This is not quite how Chrome does things.
285-
// Review our test case against browsers more comprehensively.
286-
287284
var hostEnd = -1;
288285
var atSign = -1;
289286
var nonHost = -1;
Collapse file

‎test/parallel/test-cluster-http-pipe.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-cluster-http-pipe.js
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ if (cluster.isMaster) {
4545
http.createServer(common.mustCall((req, res) => {
4646
assert.strictEqual(req.connection.remoteAddress, undefined);
4747
assert.strictEqual(req.connection.localAddress, undefined);
48-
// TODO common.PIPE?
4948

5049
res.writeHead(200);
5150
res.end('OK');
Collapse file

‎test/parallel/test-fs-error-messages.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-error-messages.js
+11-12Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -636,22 +636,21 @@ if (!common.isAIX) {
636636
);
637637
}
638638

639-
// copyFile with invalid flags
639+
// Check copyFile with invalid flags.
640640
{
641-
const validateError = (err) => {
642-
assert.strictEqual(err.message,
643-
'EINVAL: invalid argument, copyfile ' +
644-
`'${existingFile}' -> '${nonexistentFile}'`);
645-
assert.strictEqual(err.errno, uv.UV_EINVAL);
646-
assert.strictEqual(err.code, 'EINVAL');
647-
assert.strictEqual(err.syscall, 'copyfile');
648-
return true;
641+
const validateError = {
642+
// TODO: Make sure the error message always also contains the src.
643+
message: `EINVAL: invalid argument, copyfile -> '${nonexistentFile}'`,
644+
errno: uv.UV_EINVAL,
645+
code: 'EINVAL',
646+
syscall: 'copyfile'
649647
};
650648

651-
// TODO(joyeecheung): test fs.copyFile() when uv_fs_copyfile does not
652-
// keep the loop open when the flags are invalid.
653-
// See https://github.com/libuv/libuv/pull/1747
649+
fs.copyFile(existingFile, nonexistentFile, -1,
650+
common.expectsError(validateError));
654651

652+
validateError.message = 'EINVAL: invalid argument, copyfile ' +
653+
`'${existingFile}' -> '${nonexistentFile}'`;
655654
assert.throws(
656655
() => fs.copyFileSync(existingFile, nonexistentFile, -1),
657656
validateError
Collapse file

‎test/parallel/test-util-isDeepStrictEqual.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-util-isDeepStrictEqual.js
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,6 @@ notUtilIsDeepStrict([1, , , 3], [1, , , 3, , , ]);
419419
const err3 = new TypeError('foo1');
420420
notUtilIsDeepStrict(err1, err2, assert.AssertionError);
421421
notUtilIsDeepStrict(err1, err3, assert.AssertionError);
422-
// TODO: evaluate if this should throw or not. The same applies for RegExp
423-
// Date and any object that has the same keys but not the same prototype.
424422
notUtilIsDeepStrict(err1, {}, assert.AssertionError);
425423
}
426424

0 commit comments

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