2023-01-14 08:38:15 -05:00
|
|
|
import { NODE_MODULE_LOADER, DYNAMIC_MODULE_LOADER } from "@/utils/reflection/module-loader";
|
|
|
|
|
|
|
|
describe("NODE_MODULE_LOADER", () => {
|
2023-05-20 08:10:21 -04:00
|
|
|
test("returns undefined if a module cannot be loaded", () => {
|
2023-05-19 15:46:04 -04:00
|
|
|
// https://github.com/nodejs/node/issues/35889
|
|
|
|
// Jest throws segfault if we try to actually test it, so...
|
|
|
|
expect(NODE_MODULE_LOADER).toBeDefined();
|
2023-01-14 08:38:15 -05:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe("DYNAMIC_MODULE_LOADER", () => {
|
|
|
|
test("returns undefined if a module cannot be loaded", async () => {
|
|
|
|
const loadedModule = await DYNAMIC_MODULE_LOADER("#");
|
|
|
|
|
|
|
|
expect(loadedModule).toBeUndefined();
|
|
|
|
});
|
|
|
|
});
|