mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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:
@@ -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/
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user