From 48030a4effc56d4e5a0bf24da813cf874b74709f Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Thu, 19 Sep 2024 10:52:29 +0200 Subject: [PATCH] test: fix test expecations after Node.js 22.9.0 (#32695) --- .../src/server/socksClientCertificatesInterceptor.ts | 2 +- tests/playwright-test/babel.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/playwright-core/src/server/socksClientCertificatesInterceptor.ts b/packages/playwright-core/src/server/socksClientCertificatesInterceptor.ts index 08aaa4f25a..b041ffb829 100644 --- a/packages/playwright-core/src/server/socksClientCertificatesInterceptor.ts +++ b/packages/playwright-core/src/server/socksClientCertificatesInterceptor.ts @@ -346,7 +346,7 @@ function rewriteToLocalhostIfNeeded(host: string): string { } export function rewriteOpenSSLErrorIfNeeded(error: Error): Error { - if (error.message !== 'unsupported') + if (error.message !== 'unsupported' && (error as NodeJS.ErrnoException).code !== 'ERR_CRYPTO_UNSUPPORTED_OPERATION') return error; return rewriteErrorMessage(error, [ 'Unsupported TLS certificate.', diff --git a/tests/playwright-test/babel.spec.ts b/tests/playwright-test/babel.spec.ts index 3fb0a1a725..724a2a98ad 100644 --- a/tests/playwright-test/babel.spec.ts +++ b/tests/playwright-test/babel.spec.ts @@ -148,5 +148,5 @@ test('should not transform external', async ({ runInlineTest }) => { ` }); expect(result.exitCode).toBe(1); - expect(result.output).toContain('Cannot use import statement outside a module'); + expect(result.output).toMatch(/(Cannot use import statement outside a module|require\(\) of ES Module .* not supported.)/); });