Skip to content

Commit

Permalink
test: fix should not transform external for newer Node versions (#3…
Browse files Browse the repository at this point in the history
  • Loading branch information
dgozman authored Dec 13, 2024
1 parent c700a84 commit 258881b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/playwright-test/babel.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,13 @@ test('should not transform external', async ({ runInlineTest }) => {
});
`,
'a.spec.ts': `
import { test, expect } from '@playwright/test';
const { test, expect, Page } = require('@playwright/test');
let page: Page;
test('succeeds', () => {});
`
});
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]) {
Expand Down

0 comments on commit 258881b

Please sign in to comment.