Thanks to visit codestin.com Credit goes to github.com
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 f5bb1b3 commit b83571dCopy full SHA for b83571d
test/parallel/test-path-resolve.js
@@ -69,3 +69,12 @@ if (common.isWindows) {
69
const resolvedPath = spawnResult.stdout.toString().trim();
70
assert.strictEqual(resolvedPath.toLowerCase(), process.cwd().toLowerCase());
71
}
72
+
73
+if (!common.isWindows) {
74
+ // Test handling relative paths to be safe when process.cwd() fails.
75
+ process.cwd = () => '';
76
+ assert.strictEqual(process.cwd(), '');
77
+ const resolved = path.resolve();
78
+ const expected = '.';
79
+ assert.strictEqual(resolved, expected);
80
+}
0 commit comments