From 4741e642c1a04c4a5202e2b8c84117d82a60cd4b Mon Sep 17 00:00:00 2001 From: michelkaporin Date: Mon, 26 Sep 2022 12:16:08 +0200 Subject: [PATCH] fix: tests relying on exact results number --- tests/analysis.spec.ts | 2 +- tests/api.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/analysis.spec.ts b/tests/analysis.spec.ts index 7f9256eb..df422df0 100644 --- a/tests/analysis.spec.ts +++ b/tests/analysis.spec.ts @@ -70,7 +70,7 @@ describe('Functional test of analysis', () => { if (bundle.analysisResults.type !== 'sarif') return; expect(bundle.analysisResults.sarif.runs[0].tool.driver.rules?.length).toBeGreaterThan(0); - expect(bundle.analysisResults.sarif.runs[0].results?.length).toEqual(17); + expect(bundle.analysisResults.sarif.runs[0].results?.length).toBeGreaterThan(0); const sampleRes = bundle.analysisResults.sarif.runs[0].results!.find( res => res.locations?.[0].physicalLocation?.artifactLocation?.uri === `GitHubAccessTokenScrambler12.java`, ); diff --git a/tests/api.spec.ts b/tests/api.spec.ts index 81e503d4..5c7969fd 100644 --- a/tests/api.spec.ts +++ b/tests/api.spec.ts @@ -322,7 +322,7 @@ describe('Requests to public API', () => { expect(response.value.status !== AnalysisStatus.failed).toBeTruthy(); if (response.value.status === AnalysisStatus.complete && response.value.type === 'sarif') { - expect(response.value.sarif.runs[0].results).toBeGreaterThan(0); + expect(response.value.sarif.runs[0].results?.length).toBeGreaterThan(0); expect(new Set(response.value.coverage)).toEqual( new Set([