test: remove loop over single element

This loop used to iterate over two elements, but since commit
215f4d04b7, it only iterates over
a single element. Therefore, move the test out of the loop body
and remove the loop itself.

Refs: https://github.com/nodejs/node/pull/50973
PR-URL: https://github.com/nodejs/node/pull/58368
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
This commit is contained in:
Tobias Nießen
2025-05-19 14:24:07 +01:00
committed by GitHub
parent 35180bafd7
commit eab4ccfade

View File

@@ -561,17 +561,14 @@ for (const test of TEST_CASES) {
const iv = Buffer.alloc(12);
const opts = { authTagLength: 10 };
for (const cipher of [
crypto.createCipheriv(algo, key, iv, opts),
]) {
assert.throws(() => {
cipher.final();
}, hasOpenSSL3 ? {
code: 'ERR_OSSL_TAG_NOT_SET'
} : {
message: /Unsupported state/
});
}
const cipher = crypto.createCipheriv(algo, key, iv, opts);
assert.throws(() => {
cipher.final();
}, hasOpenSSL3 ? {
code: 'ERR_OSSL_TAG_NOT_SET'
} : {
message: /Unsupported state/
});
}
{