From 57eb6b2129e2f240fe9ca2a675ceceee8f219193 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 31 Mar 2019 01:35:59 -0400 Subject: [PATCH] test: fix error code typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport-PR-URL: https://github.com/nodejs/node/pull/27776 PR-URL: https://github.com/nodejs/node/pull/27024 Reviewed-By: Richard Lau Reviewed-By: Rich Trott Reviewed-By: Anatoli Papirovski Reviewed-By: Yongsheng Zhang Reviewed-By: Michaƫl Zasso Reviewed-By: Ruben Bridgewater Reviewed-By: Luigi Pinca --- test/known_issues/test-fs-copyfile-respect-permissions.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/known_issues/test-fs-copyfile-respect-permissions.js b/test/known_issues/test-fs-copyfile-respect-permissions.js index 0ebc5fbfc1dbed..34697eea6c0bef 100644 --- a/test/known_issues/test-fs-copyfile-respect-permissions.js +++ b/test/known_issues/test-fs-copyfile-respect-permissions.js @@ -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 }; @@ -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.