diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status index 76e46b80719e07..a46d3c52b1500e 100644 --- a/test/parallel/parallel.status +++ b/test/parallel/parallel.status @@ -26,12 +26,9 @@ test-async-context-frame: PASS, FLAKY test-runner-run-watch: PASS, FLAKY # https://github.com/nodejs/node/pull/59408#issuecomment-3170650933 test-fs-cp-sync-error-on-exist: PASS, FLAKY -test-fs-cp-sync-copy-symlink-not-pointing-to-folder: PASS, FLAKY test-fs-cp-sync-symlink-points-to-dest-error: PASS, FLAKY -test-fs-cp-sync-resolve-relative-symlinks-false: PASS, FLAKY test-fs-cp-async-symlink-points-to-dest: PASS, FLAKY test-fs-cp-sync-unicode-folder-names: PASS, FLAKY -test-fs-cp-sync-resolve-relative-symlinks-default: PASS, FLAKY # https://github.com/nodejs/node/issues/56751 test-without-async-context-frame: PASS, FLAKY diff --git a/test/parallel/test-fs-cp-sync-copy-symlink-not-pointing-to-folder.mjs b/test/parallel/test-fs-cp-sync-copy-symlink-not-pointing-to-folder.mjs index d23a2c8be63e6c..fa5ec6a7dbc821 100644 --- a/test/parallel/test-fs-cp-sync-copy-symlink-not-pointing-to-folder.mjs +++ b/test/parallel/test-fs-cp-sync-copy-symlink-not-pointing-to-folder.mjs @@ -1,5 +1,5 @@ // This tests that cpSync copies link if it does not point to folder in src. -import { mustNotMutateObjectDeep } from '../common/index.mjs'; +import { mustNotMutateObjectDeep, isWindows } from '../common/index.mjs'; import { nextdir } from '../common/fs.js'; import assert from 'node:assert'; import { cpSync, mkdirSync, symlinkSync, readlinkSync } from 'node:fs'; @@ -16,4 +16,11 @@ mkdirSync(join(dest, 'a'), mustNotMutateObjectDeep({ recursive: true })); symlinkSync(dest, join(dest, 'a', 'c')); cpSync(src, dest, mustNotMutateObjectDeep({ recursive: true })); const link = readlinkSync(join(dest, 'a', 'c')); -assert.strictEqual(link, src); + +if (isWindows) { + // On Windows, readlinkSync() may return a path with uppercase drive letter, + // but paths are case-insensitive. + assert.strictEqual(link.toLowerCase(), src.toLowerCase()); +} else { + assert.strictEqual(link, src); +} diff --git a/test/parallel/test-fs-cp-sync-resolve-relative-symlinks-default.mjs b/test/parallel/test-fs-cp-sync-resolve-relative-symlinks-default.mjs index 070fabd438749e..7c7622ed4050b2 100644 --- a/test/parallel/test-fs-cp-sync-resolve-relative-symlinks-default.mjs +++ b/test/parallel/test-fs-cp-sync-resolve-relative-symlinks-default.mjs @@ -1,5 +1,5 @@ // This tests that cpSync resolves relative symlinks to their absolute path by default. -import { mustNotMutateObjectDeep } from '../common/index.mjs'; +import { mustNotMutateObjectDeep, isWindows } from '../common/index.mjs'; import { nextdir } from '../common/fs.js'; import assert from 'node:assert'; import { cpSync, mkdirSync, writeFileSync, symlinkSync, readlinkSync } from 'node:fs'; @@ -18,4 +18,11 @@ mkdirSync(dest, mustNotMutateObjectDeep({ recursive: true })); cpSync(src, dest, mustNotMutateObjectDeep({ recursive: true })); const link = readlinkSync(join(dest, 'bar.js')); -assert.strictEqual(link, join(src, 'foo.js')); + +if (isWindows) { + // On Windows, readlinkSync() may return a path with uppercase drive letter, + // but paths are case-insensitive. + assert.strictEqual(link.toLowerCase(), join(src, 'foo.js').toLowerCase()); +} else { + assert.strictEqual(link, join(src, 'foo.js')); +} diff --git a/test/parallel/test-fs-cp-sync-resolve-relative-symlinks-false.mjs b/test/parallel/test-fs-cp-sync-resolve-relative-symlinks-false.mjs index e5f59d655f33f7..ac1ec01fd0b6ef 100644 --- a/test/parallel/test-fs-cp-sync-resolve-relative-symlinks-false.mjs +++ b/test/parallel/test-fs-cp-sync-resolve-relative-symlinks-false.mjs @@ -1,5 +1,5 @@ // This tests that cpSync resolves relative symlinks when verbatimSymlinks is false. -import { mustNotMutateObjectDeep } from '../common/index.mjs'; +import { mustNotMutateObjectDeep, isWindows } from '../common/index.mjs'; import { nextdir } from '../common/fs.js'; import assert from 'node:assert'; import { cpSync, mkdirSync, writeFileSync, symlinkSync, readlinkSync } from 'node:fs'; @@ -18,4 +18,11 @@ mkdirSync(dest, mustNotMutateObjectDeep({ recursive: true })); cpSync(src, dest, mustNotMutateObjectDeep({ recursive: true, verbatimSymlinks: false })); const link = readlinkSync(join(dest, 'bar.js')); -assert.strictEqual(link, join(src, 'foo.js')); + +if (isWindows) { + // On Windows, readlinkSync() may return a path with uppercase drive letter, + // but paths are case-insensitive. + assert.strictEqual(link.toLowerCase(), join(src, 'foo.js').toLowerCase()); +} else { + assert.strictEqual(link, join(src, 'foo.js')); +}