mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: don't mask ESM error (#14628)
This commit is contained in:
parent
9711e62882
commit
c4b003a29a
@ -289,9 +289,6 @@ export class Loader {
|
|||||||
${'='.repeat(80)}\n`);
|
${'='.repeat(80)}\n`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error instanceof SyntaxError && error.message.includes('Cannot use import statement outside a module'))
|
|
||||||
throw errorWithFile(file, 'JavaScript files must end with .mjs to use import.');
|
|
||||||
|
|
||||||
throw error;
|
throw error;
|
||||||
} finally {
|
} finally {
|
||||||
revertBabelRequire();
|
revertBabelRequire();
|
||||||
|
@ -175,7 +175,7 @@ test('should throw a nice error if a js file uses import', async ({ runInlineTes
|
|||||||
});
|
});
|
||||||
expect(exitCode).toBe(1);
|
expect(exitCode).toBe(1);
|
||||||
expect(output).toContain('a.spec.js');
|
expect(output).toContain('a.spec.js');
|
||||||
expect(output).toContain('JavaScript files must end with .mjs to use import.');
|
expect(output).toContain('Cannot use import statement outside a module');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should load esm when package.json has type module', async ({ runInlineTest }) => {
|
test('should load esm when package.json has type module', async ({ runInlineTest }) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user