test: fix should not transform external for newer Node versions
This commit is contained in:
parent
b0cec5b351
commit
8f07344f0f
|
|
@ -143,12 +143,13 @@ test('should not transform external', async ({ runInlineTest }) => {
|
||||||
});
|
});
|
||||||
`,
|
`,
|
||||||
'a.spec.ts': `
|
'a.spec.ts': `
|
||||||
import { test, expect } from '@playwright/test';
|
const { test, expect, Page } = require('@playwright/test');
|
||||||
|
let page: Page;
|
||||||
test('succeeds', () => {});
|
test('succeeds', () => {});
|
||||||
`
|
`
|
||||||
});
|
});
|
||||||
expect(result.exitCode).toBe(1);
|
expect(result.exitCode).toBe(1);
|
||||||
expect(result.output).toMatch(/(Cannot use import statement outside a module|require\(\) of ES Module .* not supported.)/);
|
expect(result.output).toContain(`SyntaxError: Unexpected token ':'`);
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const type of ['module', undefined]) {
|
for (const type of ['module', undefined]) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue