mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
18 lines
654 B
JavaScript
18 lines
654 B
JavaScript
//! These tests are targetting an assertion failure, but that mistake indicates a mistake
|
|
//! in the module resolver, which is that it should not query the file system in a relative
|
|
//! manner when the referrer is not a filesystem path.
|
|
|
|
test("you can't crash the resolver with import.meta.resolve/Sync", () => {
|
|
expect(() => {
|
|
console.log(import.meta.resolveSync("#foo", "file:/Users/chloe"));
|
|
}).toThrow();
|
|
expect(() => {
|
|
console.log(import.meta.resolve("#foo", "file:/Users/chloe"));
|
|
}).toThrow();
|
|
});
|
|
|
|
// TODO(@paperclover): ensure this crash isn't possible.
|
|
test.todo("you can't crash the resolver with Bun.plugin", () => {
|
|
//
|
|
});
|