mirror of
https://github.com/denoland/deno.git
synced 2025-08-02 18:12:39 +00:00
feat(npm): implement Node API (#13633)
This PR implements the NAPI for loading native modules into Deno. Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: DjDeveloper <43033058+DjDeveloperr@users.noreply.github.com> Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
This commit is contained in:
parent
3a3a848406
commit
0b016a7fb8
55 changed files with 5299 additions and 2 deletions
16
test_napi/async_test.js
Normal file
16
test_napi/async_test.js
Normal file
|
@ -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);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue