diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2019-09-26 00:46:58 +1000 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-09-25 10:46:58 -0400 |
commit | 3d2d0ee771abe308aee9a0ab6c89fd09bac80330 (patch) | |
tree | 5cc74b1e38b824d083306c5264a484d64ee6d248 /cli/tests | |
parent | 112ce0df1f9e36a57b520aa59dc1767ba0716bb0 (diff) |
Handle uncaught worker errors without panicking (#3019)
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/error_worker_dynamic.ts | 3 | ||||
-rw-r--r-- | cli/tests/error_worker_dynamic.ts.out | 3 | ||||
-rw-r--r-- | cli/tests/integration_tests.rs | 7 |
3 files changed, 13 insertions, 0 deletions
diff --git a/cli/tests/error_worker_dynamic.ts b/cli/tests/error_worker_dynamic.ts new file mode 100644 index 000000000..16fadf573 --- /dev/null +++ b/cli/tests/error_worker_dynamic.ts @@ -0,0 +1,3 @@ +const b = new Blob(['throw new Error("hello");']); +const blobURL = URL.createObjectURL(b); +new Worker(blobURL); diff --git a/cli/tests/error_worker_dynamic.ts.out b/cli/tests/error_worker_dynamic.ts.out new file mode 100644 index 000000000..4bea7b656 --- /dev/null +++ b/cli/tests/error_worker_dynamic.ts.out @@ -0,0 +1,3 @@ +[WILDCARD]error: Uncaught Error: hello +[WILDCARD]__anonymous__:1:7 + at [WILDCARD]__anonymous__:1:7 diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 4bb7fbe6e..99ab54a02 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -474,6 +474,13 @@ itest!(error_type_definitions { output: "error_type_definitions.ts.out", }); +itest!(error_worker_dynamic { + args: "run --reload error_worker_dynamic.ts", + check_stderr: true, + exit_code: 1, + output: "error_worker_dynamic.ts.out", +}); + itest!(exit_error42 { exit_code: 42, args: "run --reload exit_error42.ts", |