From 77fb26e143d635f713a1ded93100210878c61f19 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 2 Nov 2022 19:08:09 -0400 Subject: fix(npm): add `console` global for node environment (#16519) This global is already isolated to node during type checking. Closes #16518 --- .../npm/registry/@denotest/cjs-local-global-decls/1.0.0/index.js | 4 ++-- .../npm/registry/@denotest/cjs-local-global-decls/1.0.0/other.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 cli/tests/testdata/npm/registry/@denotest/cjs-local-global-decls/1.0.0/other.js (limited to 'cli/tests/testdata') 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."); -- cgit v1.2.3