diff options
Diffstat (limited to 'tests/napi/uv_test.js')
-rw-r--r-- | tests/napi/uv_test.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/napi/uv_test.js b/tests/napi/uv_test.js new file mode 100644 index 000000000..6d8ee2671 --- /dev/null +++ b/tests/napi/uv_test.js @@ -0,0 +1,18 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. + +import { assertEquals, loadTestLibrary } from "./common.js"; + +const uv = loadTestLibrary(); + +Deno.test("napi uv async", async () => { + let called = false; + await new Promise((resolve) => { + uv.test_uv_async((value) => { + called = true; + if (value === 5) { + resolve(); + } + }); + }); + assertEquals(called, true); +}); |