Skip to content

Commit

Permalink
improvement:Replace forEach() and push() wth filter() in test-webcryp…
Browse files Browse the repository at this point in the history
…to-keygen.js
  • Loading branch information
SaiHemanth-uab committed Sep 22, 2023
1 parent e329a11 commit e55800d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions test/parallel/test-webcrypto-keygen.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,7 @@ const vectors = {
{ message: /Usages cannot be empty/ });
}

const invalidUsages = [];
allUsages.forEach((usage) => {
if (!vectors[name].usages.includes(usage))
invalidUsages.push(usage);
});
const invalidUsages = allUsages.filter(usage => !vectors[name].usages.includes(usage));
for (const invalidUsage of invalidUsages) {
await assert.rejects(
subtle.generateKey(
Expand Down

0 comments on commit e55800d

Please sign in to comment.