From 5268fa0e0f34571f0fc615eb665747863aca311e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 24 Aug 2022 14:54:20 +0200 Subject: fix(unstable): various resolution bugs for npm: specifiers (#15546) Co-authored-by: David Sherret --- cli/tests/testdata/npm/dynamic_import/main.out | 1 + cli/tests/testdata/npm/dynamic_import/other.ts | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'cli/tests') diff --git a/cli/tests/testdata/npm/dynamic_import/main.out b/cli/tests/testdata/npm/dynamic_import/main.out index 7e2fb7a0f..cefb3ad44 100644 --- a/cli/tests/testdata/npm/dynamic_import/main.out +++ b/cli/tests/testdata/npm/dynamic_import/main.out @@ -3,3 +3,4 @@ Download http://localhost:4545/npm/registry/chalk Download http://localhost:4545/npm/registry/chalk/chalk-5.0.1.tgz B C +devDependency import failed: TypeError: Relative import path "xo"[WILDCARD] \ No newline at end of file diff --git a/cli/tests/testdata/npm/dynamic_import/other.ts b/cli/tests/testdata/npm/dynamic_import/other.ts index e5d3b6dc3..008f8833e 100644 --- a/cli/tests/testdata/npm/dynamic_import/other.ts +++ b/cli/tests/testdata/npm/dynamic_import/other.ts @@ -2,3 +2,10 @@ console.log("B"); const chalk = (await import("npm:chalk@5")).default; console.log(chalk.green("C")); + +try { + // Trying to import a devDependency should result in an error + await import("xo"); +} catch (e) { + console.error("devDependency import failed:", e); +} -- cgit v1.2.3