mirror of
https://github.com/denoland/deno.git
synced 2024-11-22 15:06:54 -05:00
19 lines
422 B
JavaScript
19 lines
422 B
JavaScript
|
// 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);
|
||
|
});
|