Skip to content
Browse files

test: cover path empty string case

In path.toNamespacePath was a case when the path
was empty string and it wasn't covered in the tests.

I covered this case both in Windows and Unix environments.

PR-URL: #24569
Reviewed-By: Colin Ihrig <>
Reviewed-By: Trivikram Kamat <>
Reviewed-By: James M Snell <>
  • Loading branch information...
lakatostamas authored and BethGriggs committed Nov 22, 2018
1 parent ef68349 commit 288a421dcc878b0e9c91856cc20ef83d9f06016f
Showing with 2 additions and 0 deletions.
  1. +2 −0 test/parallel/test-path-makelong.js
@@ -43,6 +43,7 @@ if (common.isWindows) {

assert.strictEqual(path.toNamespacedPath(''), '');
assert.strictEqual(path.toNamespacedPath(null), null);
assert.strictEqual(path.toNamespacedPath(100), 100);
assert.strictEqual(path.toNamespacedPath(path), path);
@@ -60,6 +61,7 @@ assert.strictEqual(path.posix.toNamespacedPath(emptyObj), emptyObj);
if (common.isWindows) {
// These tests cause resolve() to insert the cwd, so we cannot test them from
// non-Windows platforms (easily)
assert.strictEqual(path.toNamespacedPath(''), '');

0 comments on commit 288a421

Please sign in to comment.
You can’t perform that action at this time.