summaryrefslogtreecommitdiff
path: root/tests/napi/callback_test.js
diff options
context:
space:
mode:
authorhaturau <135221985+haturatu@users.noreply.github.com>2024-11-20 01:20:47 +0900
committerGitHub <noreply@github.com>2024-11-20 01:20:47 +0900
commit85719a67e59c7aa45bead26e4942d7df8b1b42d4 (patch)
treeface0aecaac53e93ce2f23b53c48859bcf1a36ec /tests/napi/callback_test.js
parent67697bc2e4a62a9670699fd18ad0dd8efc5bd955 (diff)
parent186b52731c6bb326c4d32905c5e732d082e83465 (diff)
Merge branch 'denoland:main' into main
Diffstat (limited to 'tests/napi/callback_test.js')
-rw-r--r--tests/napi/callback_test.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/napi/callback_test.js b/tests/napi/callback_test.js
index 98622d48d..c132fefa1 100644
--- a/tests/napi/callback_test.js
+++ b/tests/napi/callback_test.js
@@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-import { assertEquals, loadTestLibrary } from "./common.js";
+import { assertEquals, assertThrows, loadTestLibrary } from "./common.js";
const callback = loadTestLibrary();
@@ -36,3 +36,12 @@ Deno.test("napi callback run with args & recv", function () {
);
assertEquals(result, 69);
});
+
+Deno.test("napi callback handles errors correctly", function () {
+ const e = new Error("hi!");
+ assertThrows(() => {
+ callback.test_callback_throws(() => {
+ throw e;
+ });
+ }, e);
+});