summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-11-02 19:08:09 -0400
committerGitHub <noreply@github.com>2022-11-02 19:08:09 -0400
commit77fb26e143d635f713a1ded93100210878c61f19 (patch)
tree3753ae34c4ccc19c231632d28218d8066ab4ea60 /cli/tests
parent5140795662a9d5eb13031912fa193b7305779c1f (diff)
fix(npm): add `console` global for node environment (#16519)
This global is already isolated to node during type checking. Closes #16518
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/cjs-local-global-decls/1.0.0/index.js4
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/cjs-local-global-decls/1.0.0/other.js2
2 files changed, 4 insertions, 2 deletions
diff --git a/cli/tests/testdata/npm/registry/@denotest/cjs-local-global-decls/1.0.0/index.js b/cli/tests/testdata/npm/registry/@denotest/cjs-local-global-decls/1.0.0/index.js
index 75fc15d83..c7b90e5b7 100644
--- a/cli/tests/testdata/npm/registry/@denotest/cjs-local-global-decls/1.0.0/index.js
+++ b/cli/tests/testdata/npm/registry/@denotest/cjs-local-global-decls/1.0.0/index.js
@@ -1,4 +1,4 @@
// package that has all the locals defined
-const Buffer = 1, clearImmediate = 1, clearInterval = 1, clearTimeout = 1, global = 1, process = 1, setImmediate = 1, setInterval = 1, setTimeout = 1, globalThis = 1;
+const Buffer = 1, clearImmediate = 1, clearInterval = 1, clearTimeout = 1, console = 1, global = 1, process = 1, setImmediate = 1, setInterval = 1, setTimeout = 1, globalThis = 1;
const exports = 2;
-console.log("Loaded.");
+require("./other.js");
diff --git a/cli/tests/testdata/npm/registry/@denotest/cjs-local-global-decls/1.0.0/other.js b/cli/tests/testdata/npm/registry/@denotest/cjs-local-global-decls/1.0.0/other.js
new file mode 100644
index 000000000..810d852b0
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/cjs-local-global-decls/1.0.0/other.js
@@ -0,0 +1,2 @@
+const console = new global.console.Console({ stdout: process.stdout });
+console.log("Loaded.");