summaryrefslogtreecommitdiff
path: root/test_napi/async_test.js
diff options
context:
space:
mode:
Diffstat (limited to 'test_napi/async_test.js')
-rw-r--r--test_napi/async_test.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test_napi/async_test.js b/test_napi/async_test.js
new file mode 100644
index 000000000..ea1b714bd
--- /dev/null
+++ b/test_napi/async_test.js
@@ -0,0 +1,16 @@
+// Copyright 2018-2022 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);
+});