From 87f80ff6be5e2a132b583a9c380fff5db3cb2b07 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Sat, 20 Aug 2022 11:31:33 -0400 Subject: feat(unstable): initial support for npm specifiers (#15484) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartek IwaƄczuk --- cli/tests/testdata/commonjs/init.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'cli/tests/testdata/commonjs') 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); -- cgit v1.2.3