Files
bun.sh/test/js/node/missing-module.test.js
2023-07-31 19:41:41 -07:00

8 lines
366 B
JavaScript

import { expect, test } from "bun:test";
test("not implemented yet module masquerades as undefined and throws an error", () => {
const missingModule = "node:missing" + "";
expect(() => require(missingModule)).toThrow(/^Cannot find package "node:missing" from "/);
expect(() => import(missingModule)).toThrow(/^Cannot find package "node:missing" from "/);
});