summaryrefslogtreecommitdiff
path: root/tests/napi/async_test.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/napi/async_test.js')
-rw-r--r--tests/napi/async_test.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/napi/async_test.js b/tests/napi/async_test.js
new file mode 100644
index 000000000..4d9ad99c2
--- /dev/null
+++ b/tests/napi/async_test.js
@@ -0,0 +1,16 @@
+// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+
+import { assertEquals, loadTestLibrary } from "./common.js";
+
+const asyncTask = loadTestLibrary();
+
+Deno.test("napi async task schedule", async () => {
+ let called = false;
+ await new Promise((resolve) => {
+ asyncTask.test_async_work(() => {
+ called = true;
+ resolve();
+ });
+ });
+ assertEquals(called, true);
+});