fix(napi): return node globalThis from napi_get_global (#17613)

Fixes https://github.com/denoland/deno/issues/17587
This commit is contained in:
Divy Srivastava 2023-02-01 06:41:04 -08:00 committed by GitHub
parent 1b46b2f0e4
commit 524bccdf6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 68 additions and 6 deletions

12
test_napi/env_test.js Normal file
View file

@ -0,0 +1,12 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { assert, loadTestLibrary } from "./common.js";
const env = loadTestLibrary();
Deno.test("napi get global", function () {
const g = env.testNodeGlobal();
// Note: global is a mock object in the tests.
// See common.js
assert(g.Buffer);
});