Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions test/parallel/test-fs-realpath.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,15 @@ function test_cyclic_link_protection(callback) {
fs.symlinkSync(t[1], t[0], 'dir');
unlink.push(t[0]);
});
assert.throws(function() { fs.realpathSync(entry); });
asynctest(fs.realpath, [entry], callback, function(err, result) {
assert.ok(err && true);
return true;
});
assert.throws(() => {
fs.realpathSync(entry);
}, common.expectsError({ code: 'ELOOP', type: Error }));
asynctest(
fs.realpath, [entry], callback, common.mustCall(function(err, result) {
assert.ok(err.path === entry);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use assert.strictEqual() here and in the line below:

assert.strictEqual(err.path, entry);
assert.strictEqual(result, undefined);

That will provide better error messages should the assertion fire.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Trott Hi, I have made the modification as requested in another branch called test_11498. #11622

assert.ok(result === undefined);
return true;
}));
}

function test_cyclic_link_overprotection(callback) {
Expand Down