Skip to content

Commit eab4ccf

Browse files
authored
test: remove loop over single element
This loop used to iterate over two elements, but since commit 215f4d0, it only iterates over a single element. Therefore, move the test out of the loop body and remove the loop itself. Refs: #50973 PR-URL: #58368 Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]>
1 parent 35180ba commit eab4ccf

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

test/parallel/test-crypto-authenticated.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -561,17 +561,14 @@ for (const test of TEST_CASES) {
561561
const iv = Buffer.alloc(12);
562562
const opts = { authTagLength: 10 };
563563

564-
for (const cipher of [
565-
crypto.createCipheriv(algo, key, iv, opts),
566-
]) {
567-
assert.throws(() => {
568-
cipher.final();
569-
}, hasOpenSSL3 ? {
570-
code: 'ERR_OSSL_TAG_NOT_SET'
571-
} : {
572-
message: /Unsupported state/
573-
});
574-
}
564+
const cipher = crypto.createCipheriv(algo, key, iv, opts);
565+
assert.throws(() => {
566+
cipher.final();
567+
}, hasOpenSSL3 ? {
568+
code: 'ERR_OSSL_TAG_NOT_SET'
569+
} : {
570+
message: /Unsupported state/
571+
});
575572
}
576573

577574
{

0 commit comments

Comments
 (0)