diff --git a/test/parallel/test-tls-ecdh-multiple.js b/test/parallel/test-tls-ecdh-multiple.js index 5bf119f48bacad..17d2baeb9af421 100644 --- a/test/parallel/test-tls-ecdh-multiple.js +++ b/test/parallel/test-tls-ecdh-multiple.js @@ -51,11 +51,11 @@ const server = tls.createServer(options, (conn) => { ]; // Brainpool is not supported in FIPS mode. - if (common.hasFipsCrypto) - unsupportedCurves.push('brainpoolP256r1'); - - unsupportedCurves.forEach((ecdhCurve) => { - assert.throws(() => tls.createServer({ ecdhCurve }), - /Error: Failed to set ECDH curve/); - }); + if (common.hasFipsCrypto) unsupportedCurves.push('brainpoolP256r1'); + for (const ecdhCurve of unsupportedCurves) { + assert.throws( + () => tls.createServer({ ecdhCurve }), + /Error: Failed to set ECDH curve/ + ); + } }