summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/run/unhandled_rejection_dynamic_import
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/testdata/run/unhandled_rejection_dynamic_import')
-rw-r--r--cli/tests/testdata/run/unhandled_rejection_dynamic_import/import.ts5
-rw-r--r--cli/tests/testdata/run/unhandled_rejection_dynamic_import/main.ts1
-rw-r--r--cli/tests/testdata/run/unhandled_rejection_dynamic_import/main.ts.out3
3 files changed, 9 insertions, 0 deletions
diff --git a/cli/tests/testdata/run/unhandled_rejection_dynamic_import/import.ts b/cli/tests/testdata/run/unhandled_rejection_dynamic_import/import.ts
new file mode 100644
index 000000000..b490f2c20
--- /dev/null
+++ b/cli/tests/testdata/run/unhandled_rejection_dynamic_import/import.ts
@@ -0,0 +1,5 @@
+globalThis.addEventListener("unhandledrejection", () => {
+ console.log("hey");
+});
+console.log("---");
+Promise.reject();
diff --git a/cli/tests/testdata/run/unhandled_rejection_dynamic_import/main.ts b/cli/tests/testdata/run/unhandled_rejection_dynamic_import/main.ts
new file mode 100644
index 000000000..244d84467
--- /dev/null
+++ b/cli/tests/testdata/run/unhandled_rejection_dynamic_import/main.ts
@@ -0,0 +1 @@
+await import("./import.ts");
diff --git a/cli/tests/testdata/run/unhandled_rejection_dynamic_import/main.ts.out b/cli/tests/testdata/run/unhandled_rejection_dynamic_import/main.ts.out
new file mode 100644
index 000000000..f44c6d2ff
--- /dev/null
+++ b/cli/tests/testdata/run/unhandled_rejection_dynamic_import/main.ts.out
@@ -0,0 +1,3 @@
+---
+hey
+error: Uncaught (in promise) undefined