aboutsummaryrefslogtreecommitdiff
path: root/test/js/node/missing-module.test.js
blob: fd772441a8a657f26a797da7a0b6a90a9082e87a (plain) (blame)
1
2
3
4
5
6
7
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 "/);
});