diff options
author | cjihrig <cjihrig@gmail.com> | 2019-04-15 11:43:56 -0400 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2019-04-22 12:04:35 -0400 |
commit | b368571fba2bd7bceb18a3ef64d20769ca13bd27 (patch) | |
tree | 600b05b2889d9a1a4de1b1b4f95ccd3fdd358387 /test/known_issues | |
parent | aec2ce4ee11c766d4c7fcc532f794a758404a6c7 (diff) | |
download | android-node-v8-b368571fba2bd7bceb18a3ef64d20769ca13bd27.tar.gz android-node-v8-b368571fba2bd7bceb18a3ef64d20769ca13bd27.tar.bz2 android-node-v8-b368571fba2bd7bceb18a3ef64d20769ca13bd27.zip |
test: move known issue test to parallel
As of libuv 1.28.0, this bug is fixed, and the test can be
moved to parallel. This commit also updates an error code
check to work on Windows.
PR-URL: https://github.com/nodejs/node/pull/27241
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'test/known_issues')
-rw-r--r-- | test/known_issues/test-fs-copyfile-respect-permissions.js | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/test/known_issues/test-fs-copyfile-respect-permissions.js b/test/known_issues/test-fs-copyfile-respect-permissions.js deleted file mode 100644 index 34697eea6c..0000000000 --- a/test/known_issues/test-fs-copyfile-respect-permissions.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -// Test that fs.copyFile() respects file permissions. -// Ref: https://github.com/nodejs/node/issues/26936 - -const common = require('../common'); - -const tmpdir = require('../common/tmpdir'); -tmpdir.refresh(); - -const assert = require('assert'); -const fs = require('fs'); -const path = require('path'); - -let n = 0; - -function beforeEach() { - n++; - const source = path.join(tmpdir.path, `source${n}`); - const dest = path.join(tmpdir.path, `dest${n}`); - fs.writeFileSync(source, 'source'); - fs.writeFileSync(dest, 'dest'); - fs.chmodSync(dest, '444'); - - const check = (err) => { - assert.strictEqual(err.code, 'EACCES'); - assert.strictEqual(fs.readFileSync(dest, 'utf8'), 'dest'); - return true; - }; - - return { source, dest, check }; -} - -// Test synchronous API. -{ - const { source, dest, check } = beforeEach(); - assert.throws(() => { fs.copyFileSync(source, dest); }, check); -} - -// Test promises API. -{ - const { source, dest, check } = beforeEach(); - (async () => { - await assert.rejects(fs.promises.copyFile(source, dest), check); - })(); -} - -// Test callback API. -{ - const { source, dest, check } = beforeEach(); - fs.copyFile(source, dest, common.mustCall(check)); -} |