Skip to content

Commit

Permalink
♻️ Use all test data
Browse files Browse the repository at this point in the history
Removes random selection of test cases.
  • Loading branch information
superbuggy committed Sep 6, 2024
1 parent aabd18f commit 10c24fe
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cvss40.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ describe('CVSS 4.0', () => {
return data;
}, {});

const randomlyPickFrom = (count, array) => array.slice(0, count).sort(() => 0.5 - Math.random());
Object.entries(testData).forEach(([fileName, vectorScores]) => {
const count = 10000;
it(`should calculate ${count} random scores in ${fileName} correctly`, () => {
randomlyPickFrom(count, vectorScores).forEach(({ vector, score }) => {
it(`should calculate scores in ${fileName} correctly`, () => {
vectorScores.forEach(({ vector, score }) => {
expect(new CVSS40(vector).score).toBe(score);
});
});
Expand Down

0 comments on commit 10c24fe

Please sign in to comment.