From 258881bea10425d98551117dc26fcf083426b9f9 Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Fri, 13 Dec 2024 17:17:49 +0000 Subject: [PATCH] test: fix `should not transform external` for newer Node versions (#34006) --- tests/playwright-test/babel.spec.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/playwright-test/babel.spec.ts b/tests/playwright-test/babel.spec.ts index 517d813bc84be..340fda91ad584 100644 --- a/tests/playwright-test/babel.spec.ts +++ b/tests/playwright-test/babel.spec.ts @@ -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]) {