summaryrefslogtreecommitdiff
path: root/tests/specs/run/fix_dynamic_import_errors
diff options
context:
space:
mode:
Diffstat (limited to 'tests/specs/run/fix_dynamic_import_errors')
-rw-r--r--tests/specs/run/fix_dynamic_import_errors/__test__.jsonc4
-rw-r--r--tests/specs/run/fix_dynamic_import_errors/b.js2
-rw-r--r--tests/specs/run/fix_dynamic_import_errors/c.js2
-rw-r--r--tests/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js7
-rw-r--r--tests/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js.out2
5 files changed, 17 insertions, 0 deletions
diff --git a/tests/specs/run/fix_dynamic_import_errors/__test__.jsonc b/tests/specs/run/fix_dynamic_import_errors/__test__.jsonc
new file mode 100644
index 000000000..d9302d2ca
--- /dev/null
+++ b/tests/specs/run/fix_dynamic_import_errors/__test__.jsonc
@@ -0,0 +1,4 @@
+{
+ "args": "run --reload fix_dynamic_import_errors.js",
+ "output": "fix_dynamic_import_errors.js.out"
+}
diff --git a/tests/specs/run/fix_dynamic_import_errors/b.js b/tests/specs/run/fix_dynamic_import_errors/b.js
new file mode 100644
index 000000000..6ea50d360
--- /dev/null
+++ b/tests/specs/run/fix_dynamic_import_errors/b.js
@@ -0,0 +1,2 @@
+import "./bad.mjs";
+export default () => "error";
diff --git a/tests/specs/run/fix_dynamic_import_errors/c.js b/tests/specs/run/fix_dynamic_import_errors/c.js
new file mode 100644
index 000000000..20546455e
--- /dev/null
+++ b/tests/specs/run/fix_dynamic_import_errors/c.js
@@ -0,0 +1,2 @@
+await import("./bad2.mjs");
+export default () => "error";
diff --git a/tests/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js b/tests/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js
new file mode 100644
index 000000000..e105cbada
--- /dev/null
+++ b/tests/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js
@@ -0,0 +1,7 @@
+import("./b.js").catch(() => {
+ console.log("caught import error from b.js");
+});
+
+import("./c.js").catch(() => {
+ console.log("caught import error from c.js");
+});
diff --git a/tests/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js.out b/tests/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js.out
new file mode 100644
index 000000000..e7856fb9c
--- /dev/null
+++ b/tests/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js.out
@@ -0,0 +1,2 @@
+caught import error from [WILDCARD].js
+caught import error from [WILDCARD].js