diff options
Diffstat (limited to 'test/js/node/missing-module.test.js')
-rw-r--r-- | test/js/node/missing-module.test.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/js/node/missing-module.test.js b/test/js/node/missing-module.test.js new file mode 100644 index 000000000..fd772441a --- /dev/null +++ b/test/js/node/missing-module.test.js @@ -0,0 +1,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 "/); +}); |