Files
bun.sh/test/js/node/missing-module.test.js
Meghan Denny 6f60523e6c " -> ' (#14776)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-23 19:21:36 -07:00

8 lines
337 B
JavaScript

import { expect, test } from "bun:test";
test("not implemented yet module 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 '/);
});