test: fix test expecations after Node.js 22.9.0 (#32695)

This commit is contained in:
Max Schmitt 2024-09-19 10:52:29 +02:00 committed by GitHub
parent 2f4acbb001
commit 48030a4eff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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 {
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.',

View file

@ -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.)/);
});