We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70a5862 commit 68bec19Copy full SHA for 68bec19
1 file changed
test/known_issues/test-fs-cp-sync-dereference.js
@@ -0,0 +1,39 @@
1
+'use strict';
2
+
3
+// Refs: https://github.com/nodejs/node/issues/58939
4
+//
5
+// The cpSync function is not correctly handling the `dereference` option.
6
+// In this test, both the cp and cpSync functions are attempting to copy
7
+// a file over a symlinked directory. In the cp case it works fine. In the
8
+// cpSync case it fails with an error.
9
10
+const common = require('../common');
11
12
+const {
13
+ cp,
14
+ cpSync,
15
+ mkdirSync,
16
+ symlinkSync,
17
+ writeFileSync,
18
+} = require('fs');
19
20
21
+ join,
22
+} = require('path');
23
24
+const tmpdir = require('../common/tmpdir');
25
+tmpdir.refresh();
26
27
+const pathA = join(tmpdir.path, 'a');
28
+const pathB = join(tmpdir.path, 'b');
29
+const pathC = join(tmpdir.path, 'c');
30
+const pathD = join(tmpdir.path, 'd');
31
32
+writeFileSync(pathA, 'file a');
33
+mkdirSync(pathB);
34
+symlinkSync(pathB, pathC, 'dir');
35
+symlinkSync(pathB, pathD, 'dir');
36
37
+cp(pathA, pathD, { dereference: false }, common.mustSucceed());
38
39
+cpSync(pathA, pathC, { dereference: false });
0 commit comments