summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
authorEvan <96965321+0xIchigo@users.noreply.github.com>2023-08-16 05:28:49 -0400
committerGitHub <noreply@github.com>2023-08-16 11:28:49 +0200
commit79d144579606e95774aedf79c2a165602be0205d (patch)
tree8a2419564ab3ec66011fb861dd937260e2953363 /cli/tests
parent71d2f4cb97b6cc85cf58c632ecde05cc262ff44f (diff)
fix(ext/node): allow for the reassignment of userInfo() on Windows (#20165)
The goal of this PR is to address issue #20106 where a `TypeError` occurs when the variables `uid` and `gid` from `userInfo()` in `node:os` are reassigned if the user is on Windows. Both `uid` and `gid` are marked as `const` therefore producing a `TypeError` when the two are reassigned. This PR achieves that goal by marking `uid` and `gid` as `let`
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/node_compat/test/parallel/test-os.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/cli/tests/node_compat/test/parallel/test-os.js b/cli/tests/node_compat/test/parallel/test-os.js
index 09d97222c..d8425d0d5 100644
--- a/cli/tests/node_compat/test/parallel/test-os.js
+++ b/cli/tests/node_compat/test/parallel/test-os.js
@@ -216,7 +216,6 @@ if (common.isWindows && process.env.USERPROFILE) {
process.env.HOME = home;
}
-/* TODO(kt3k): Enable this test
const pwd = os.userInfo();
is.object(pwd);
const pwdBuf = os.userInfo({ encoding: 'buffer' });
@@ -245,7 +244,7 @@ is.string(pwd.username);
assert.ok(pwd.homedir.includes(path.sep));
assert.strictEqual(pwd.username, pwdBuf.username.toString('utf8'));
assert.strictEqual(pwd.homedir, pwdBuf.homedir.toString('utf8'));
-*/
+
assert.strictEqual(`${os.hostname}`, os.hostname());
assert.strictEqual(`${os.homedir}`, os.homedir());