summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/workers
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2023-12-06 17:02:52 -0700
committerGitHub <noreply@github.com>2023-12-06 17:02:52 -0700
commit9314928990a6cbd0bc0abe3100872ba2682eda9a (patch)
tree462d19eeaac0974a752128ad5d8b64e1066be8af /cli/tests/testdata/workers
parent68d356eed91731cd0c13eb946f296aa90ef4d5ac (diff)
chore: bump deno_core and update tests (#21467)
Landing changes required for https://github.com/denoland/deno_core/pull/359 We needed to update 99_main.js and a whole load of tests. API changes: - setPromiseRejectCallback becomes setUnhandledPromiseRejectionHandler. The function is now called from eventLoopTick. - The promiseRejectMacrotaskCallback no longer exists, as this is automatically handled in eventLoopTick. - ops.op_dispatch_exception now takes a second parameter: in_promise. The preferred way to call this op is now reportUnhandledException or reportUnhandledPromiseRejection.
Diffstat (limited to 'cli/tests/testdata/workers')
-rw-r--r--cli/tests/testdata/workers/close_nested_child.js1
-rw-r--r--cli/tests/testdata/workers/error_event.ts.out4
-rw-r--r--cli/tests/testdata/workers/test.ts5
-rw-r--r--cli/tests/testdata/workers/worker_error.ts.out2
-rw-r--r--cli/tests/testdata/workers/worker_nested_error.ts.out2
5 files changed, 9 insertions, 5 deletions
diff --git a/cli/tests/testdata/workers/close_nested_child.js b/cli/tests/testdata/workers/close_nested_child.js
index bd95ae08c..7c6ad603c 100644
--- a/cli/tests/testdata/workers/close_nested_child.js
+++ b/cli/tests/testdata/workers/close_nested_child.js
@@ -4,4 +4,5 @@ console.log("Starting the child worker");
setTimeout(() => {
console.log("The child worker survived the death of the parent!!!");
+ Deno.exit(1);
}, 2000);
diff --git a/cli/tests/testdata/workers/error_event.ts.out b/cli/tests/testdata/workers/error_event.ts.out
index 9c075e23e..833cca8be 100644
--- a/cli/tests/testdata/workers/error_event.ts.out
+++ b/cli/tests/testdata/workers/error_event.ts.out
@@ -1,10 +1,10 @@
-error: Uncaught (in worker "") Error: foo
+error: Uncaught (in worker "") (in promise) Error: foo
throw new Error("foo");
^
at foo ([WILDCARD]/error.ts:2:9)
at [WILDCARD]/error.ts:5:1
{
- message: "Uncaught Error: foo",
+ message: "Uncaught (in promise) Error: foo",
filename: "[WILDCARD]/error.ts",
lineno: 2,
colno: 9
diff --git a/cli/tests/testdata/workers/test.ts b/cli/tests/testdata/workers/test.ts
index 0f0a2e1c6..e052cf46b 100644
--- a/cli/tests/testdata/workers/test.ts
+++ b/cli/tests/testdata/workers/test.ts
@@ -94,7 +94,10 @@ Deno.test({
resolve(e.message);
};
- assertMatch(await promise as string, /Uncaught Error: Thrown error/);
+ assertMatch(
+ await promise as string,
+ /Uncaught \(in promise\) Error: Thrown error/,
+ );
throwingWorker.terminate();
},
});
diff --git a/cli/tests/testdata/workers/worker_error.ts.out b/cli/tests/testdata/workers/worker_error.ts.out
index 78d0c423e..1dd017770 100644
--- a/cli/tests/testdata/workers/worker_error.ts.out
+++ b/cli/tests/testdata/workers/worker_error.ts.out
@@ -1,4 +1,4 @@
-[WILDCARD]error: Uncaught (in worker "bar") Error: foo[WILDCARD]
+[WILDCARD]error: Uncaught (in worker "bar") (in promise) Error: foo[WILDCARD]
at foo ([WILDCARD])
at [WILDCARD]
error: Uncaught (in promise) Error: Unhandled error in child worker.
diff --git a/cli/tests/testdata/workers/worker_nested_error.ts.out b/cli/tests/testdata/workers/worker_nested_error.ts.out
index 15cb85b48..3622acfb3 100644
--- a/cli/tests/testdata/workers/worker_nested_error.ts.out
+++ b/cli/tests/testdata/workers/worker_nested_error.ts.out
@@ -1,4 +1,4 @@
-[WILDCARD]error: Uncaught (in worker "bar") Error: foo[WILDCARD]
+[WILDCARD]error: Uncaught (in worker "bar") (in promise) Error: foo[WILDCARD]
throw new Error("foo");
^
at foo ([WILDCARD]/workers/error.ts:[WILDCARD])