From 95c9204ae7a6cf83c6828272eb4495e2438e40f2 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 31 Mar 2019 01:49:24 -0400 Subject: [PATCH] squash! more fixes --- test/known_issues/test-fs-copyfile-respect-permissions.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/known_issues/test-fs-copyfile-respect-permissions.js b/test/known_issues/test-fs-copyfile-respect-permissions.js index e60e1769ff9f75..34697eea6c0bef 100644 --- a/test/known_issues/test-fs-copyfile-respect-permissions.js +++ b/test/known_issues/test-fs-copyfile-respect-permissions.js @@ -25,6 +25,7 @@ function beforeEach() { const check = (err) => { 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.