mirror of
https://github.com/denoland/deno.git
synced 2024-12-28 18:19:08 -05:00
15 lines
536 B
TypeScript
15 lines
536 B
TypeScript
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||
|
|
||
|
import { Module } from "node:module";
|
||
|
import { assertStrictEquals } from "../../../test_util/std/testing/asserts.ts";
|
||
|
|
||
|
Deno.test("[node/module _preloadModules] has internal require hook", () => {
|
||
|
// Check if it's there
|
||
|
// deno-lint-ignore no-explicit-any
|
||
|
(Module as any)._preloadModules([
|
||
|
"./cli/tests/unit_node/testdata/add_global_property.js",
|
||
|
]);
|
||
|
// deno-lint-ignore no-explicit-any
|
||
|
assertStrictEquals((globalThis as any).foo, "Hello");
|
||
|
});
|