summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/commonjs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-08-20 11:31:33 -0400
committerGitHub <noreply@github.com>2022-08-20 11:31:33 -0400
commit87f80ff6be5e2a132b583a9c380fff5db3cb2b07 (patch)
treeb2c43c9004b9ada204f3b5db7c221fa6322f026a /cli/tests/testdata/commonjs
parent1ffbd561642d05a05e18ada764d50581dea779ef (diff)
feat(unstable): initial support for npm specifiers (#15484)
Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/tests/testdata/commonjs')
-rw-r--r--cli/tests/testdata/commonjs/init.js11
1 files changed, 2 insertions, 9 deletions
diff --git a/cli/tests/testdata/commonjs/init.js b/cli/tests/testdata/commonjs/init.js
index 142ae7c76..77992a0ad 100644
--- a/cli/tests/testdata/commonjs/init.js
+++ b/cli/tests/testdata/commonjs/init.js
@@ -2,16 +2,9 @@ import { fromFileUrl } from "../../../../test_util/std/path/mod.ts";
const DENO_NODE_COMPAT_URL = Deno.env.get("DENO_NODE_COMPAT_URL");
const moduleAllUrl = `${DENO_NODE_COMPAT_URL}node/module_all.ts`;
-const processUrl = `${DENO_NODE_COMPAT_URL}node/process.ts`;
let moduleName = import.meta.resolve(Deno.args[0]);
moduleName = fromFileUrl(moduleName);
-const [moduleAll, processModule] = await Promise.all([
- import(moduleAllUrl),
- import(processUrl),
-]);
-Deno[Deno.internal].require.initializeCommonJs(
- moduleAll.default,
- processModule.default,
-);
+const moduleAll = await import(moduleAllUrl);
+Deno[Deno.internal].node.initialize(moduleAll.default);
Deno[Deno.internal].require.Module._load(moduleName, null, true);