Skip to content

Commit

Permalink
esm: unflag extensionless ES module JavaScript and Wasm in module scope
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Dec 11, 2023
1 parent d2e55f9 commit 3bfa548
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion spec/esm-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,19 @@ describe('esm', () => {
});

describe('with context isolation', () => {
let badFilePath = '';

beforeEach(async () => {
badFilePath = path.resolve(path.resolve(os.tmpdir(), 'bad-file.badjs'));
await fs.promises.writeFile(badFilePath, 'const foo = "bar";');
});

afterEach(async () => {
await fs.promises.unlink(badFilePath);
});

it('should use nodes esm dynamic loader in the isolated context', async () => {
const [, preloadError] = await loadWindowWithPreload(`await import(${JSON.stringify(hostsUrl)})`, {
const [, preloadError] = await loadWindowWithPreload(`await import(${JSON.stringify((pathToFileURL(badFilePath)))})`, {
nodeIntegration: true,
sandbox: false,
contextIsolation: true
Expand Down

0 comments on commit 3bfa548

Please sign in to comment.