test: fix test expecations after Node.js 22.9.0

This commit is contained in:
Max Schmitt 2024-09-18 22:09:18 +02:00
parent d4eecafa8a
commit 1281d11c42
2 changed files with 2 additions and 2 deletions

View file

@ -346,7 +346,7 @@ function rewriteToLocalhostIfNeeded(host: string): string {
} }
export function rewriteOpenSSLErrorIfNeeded(error: Error): Error { 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 error;
return rewriteErrorMessage(error, [ return rewriteErrorMessage(error, [
'Unsupported TLS certificate.', 'Unsupported TLS certificate.',

View file

@ -148,5 +148,5 @@ test('should not transform external', async ({ runInlineTest }) => {
` `
}); });
expect(result.exitCode).toBe(1); 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.)/);
}); });