mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00

This test previously squeezed 70+ test cases into one single file and has been constantly crashing on Windows with exit code 3221226505 and no stack trace. As it is already marked as flaky there is no way to understand which test case is failing and the Windows CI was constantly orange. This patch splits the test cases into different files so it's easier to find out which case is exactly failing and to be skipped. PR-URL: https://github.com/nodejs/node/pull/59408 Refs: https://github.com/nodejs/node/issues/56794 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com> Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
28 lines
1.1 KiB
JavaScript
28 lines
1.1 KiB
JavaScript
// This tests that it does not throw errors when directory is copied over and force is false.
|
|
|
|
import { mustCall, mustNotMutateObjectDeep } from '../common/index.mjs';
|
|
import assert from 'node:assert';
|
|
import { cp, cpSync, lstatSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
import { join } from 'node:path';
|
|
import tmpdir from '../common/tmpdir.js';
|
|
import { assertDirEquivalent, nextdir } from '../common/fs.js';
|
|
|
|
tmpdir.refresh();
|
|
|
|
const src = nextdir();
|
|
mkdirSync(join(src, 'a', 'b'), mustNotMutateObjectDeep({ recursive: true }));
|
|
writeFileSync(join(src, 'README.md'), 'hello world', 'utf8');
|
|
const dest = nextdir();
|
|
cpSync(src, dest, mustNotMutateObjectDeep({ dereference: true, recursive: true }));
|
|
const initialStat = lstatSync(join(dest, 'README.md'));
|
|
cp(src, dest, {
|
|
dereference: true,
|
|
force: false,
|
|
recursive: true,
|
|
}, mustCall((err) => {
|
|
assert.strictEqual(err, null);
|
|
assertDirEquivalent(src, dest);
|
|
// File should not have been copied over, so access times will be identical:
|
|
const finalStat = lstatSync(join(dest, 'README.md'));
|
|
assert.strictEqual(finalStat.ctime.getTime(), initialStat.ctime.getTime());
|
|
}));
|