Skip to content

Commit

Permalink
test: fix error code typo
Browse files Browse the repository at this point in the history
PR-URL: nodejs#27024
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
cjihrig authored and MylesBorins committed May 20, 2019
1 parent 25d73aa commit b81c82a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/known_issues/test-fs-copyfile-respect-permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ function beforeEach() {
fs.chmodSync(dest, '444');

const check = (err) => {
assert.strictEqual(err.code, 'EACCESS');
assert.strictEqual(err.code, 'EACCES');
assert.strictEqual(fs.readFileSync(dest, 'utf8'), 'dest');
return true;
};

return { source, dest, check };
Expand All @@ -39,8 +40,9 @@ function beforeEach() {
// Test promises API.
{
const { source, dest, check } = beforeEach();
assert.throws(async () => { await fs.promises.copyFile(source, dest); },
check);
(async () => {
await assert.rejects(fs.promises.copyFile(source, dest), check);
})();
}

// Test callback API.
Expand Down

0 comments on commit b81c82a

Please sign in to comment.