From b368571fba2bd7bceb18a3ef64d20769ca13bd27 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 15 Apr 2019 11:43:56 -0400 Subject: 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 Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell Reviewed-By: Rich Trott Reviewed-By: Anna Henningsen Reviewed-By: Ben Noordhuis --- .../test-fs-copyfile-respect-permissions.js | 52 ---------------------- 1 file changed, 52 deletions(-) delete mode 100644 test/known_issues/test-fs-copyfile-respect-permissions.js (limited to 'test/known_issues') 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)); -} -- cgit v1.2.3