summaryrefslogtreecommitdiff
path: root/cli/tests/testdata
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/testdata')
-rw-r--r--cli/tests/testdata/unhandled_rejection.ts (renamed from cli/tests/testdata/unhandled_rejection.js)6
-rw-r--r--cli/tests/testdata/unhandled_rejection.ts.out (renamed from cli/tests/testdata/unhandled_rejection.js.out)9
2 files changed, 9 insertions, 6 deletions
diff --git a/cli/tests/testdata/unhandled_rejection.js b/cli/tests/testdata/unhandled_rejection.ts
index 352e861b4..388583434 100644
--- a/cli/tests/testdata/unhandled_rejection.js
+++ b/cli/tests/testdata/unhandled_rejection.ts
@@ -3,8 +3,10 @@ globalThis.addEventListener("unhandledrejection", (e) => {
e.preventDefault();
});
-function Foo() {
- this.bar = Promise.reject(new Error("bar not available"));
+class Foo {
+ constructor() {
+ Promise.reject(new Error("bar not available"));
+ }
}
new Foo();
diff --git a/cli/tests/testdata/unhandled_rejection.js.out b/cli/tests/testdata/unhandled_rejection.ts.out
index 4c41795ce..6addab20a 100644
--- a/cli/tests/testdata/unhandled_rejection.js.out
+++ b/cli/tests/testdata/unhandled_rejection.ts.out
@@ -1,8 +1,9 @@
+[WILDCARD]
unhandled rejection at: Promise {
<rejected> Error: bar not available
- at new Foo (file:///[WILDCARD]/testdata/unhandled_rejection.js:7:29)
- at file:///[WILDCARD]/testdata/unhandled_rejection.js:10:1
+ at new Foo (file:///[WILDCARD]/testdata/unhandled_rejection.ts:8:20)
+ at file:///[WILDCARD]/testdata/unhandled_rejection.ts:12:1
} reason: Error: bar not available
- at new Foo (file:///[WILDCARD]/testdata/unhandled_rejection.js:7:29)
- at file:///[WILDCARD]/testdata/unhandled_rejection.js:10:1
+ at new Foo (file:///[WILDCARD]/testdata/unhandled_rejection.ts:8:20)
+ at file:///[WILDCARD]/testdata/unhandled_rejection.ts:12:1
unhandled rejection at: Promise { <rejected> undefined } reason: undefined