summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/npm/dynamic_import
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/testdata/npm/dynamic_import')
-rw-r--r--cli/tests/testdata/npm/dynamic_import/main.out4
-rw-r--r--cli/tests/testdata/npm/dynamic_import/main.ts3
-rw-r--r--cli/tests/testdata/npm/dynamic_import/other.ts4
3 files changed, 11 insertions, 0 deletions
diff --git a/cli/tests/testdata/npm/dynamic_import/main.out b/cli/tests/testdata/npm/dynamic_import/main.out
new file mode 100644
index 000000000..3ba847c7e
--- /dev/null
+++ b/cli/tests/testdata/npm/dynamic_import/main.out
@@ -0,0 +1,4 @@
+A
+Download http://localhost:4545/npm/registry/chalk/chalk-5.0.1.tgz
+B
+C
diff --git a/cli/tests/testdata/npm/dynamic_import/main.ts b/cli/tests/testdata/npm/dynamic_import/main.ts
new file mode 100644
index 000000000..8b850a8ee
--- /dev/null
+++ b/cli/tests/testdata/npm/dynamic_import/main.ts
@@ -0,0 +1,3 @@
+const importName = "./other.ts";
+console.log("A");
+await import(importName);
diff --git a/cli/tests/testdata/npm/dynamic_import/other.ts b/cli/tests/testdata/npm/dynamic_import/other.ts
new file mode 100644
index 000000000..e5d3b6dc3
--- /dev/null
+++ b/cli/tests/testdata/npm/dynamic_import/other.ts
@@ -0,0 +1,4 @@
+console.log("B");
+const chalk = (await import("npm:chalk@5")).default;
+
+console.log(chalk.green("C"));