diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/integration/run_tests.rs | 4 | ||||
-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 |
3 files changed, 11 insertions, 8 deletions
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index d477bb896..25d84ae46 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -2784,6 +2784,6 @@ itest!(followup_dyn_import_resolved { }); itest!(unhandled_rejection { - args: "run --allow-read unhandled_rejection.js", - output: "unhandled_rejection.js.out", + args: "run --check unhandled_rejection.ts", + output: "unhandled_rejection.ts.out", }); 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 |