diff --git a/src/security/audit-gateway-exposure.test.ts b/src/security/audit-gateway-exposure.test.ts index f437e2e4c51..933c7b2bb66 100644 --- a/src/security/audit-gateway-exposure.test.ts +++ b/src/security/audit-gateway-exposure.test.ts @@ -128,7 +128,7 @@ describe("security audit gateway exposure findings", () => { const findings = collectGatewayConfigFindings(cfg, cfg, {}); expect(findings).toEqual(expect.arrayContaining([expect.objectContaining(expectedFinding)])); if (expectedNoFinding) { - expect(findings.some((finding) => finding.checkId === expectedNoFinding)).toBe(false); + expect(findings.map((finding) => finding.checkId)).not.toContain(expectedNoFinding); } }); @@ -410,10 +410,9 @@ describe("security audit gateway exposure findings", () => { testCase.name, ).toBe(true); if (testCase.suppressesGenericSharedSecretFindings) { - expect(findings.some((finding) => finding.checkId === "gateway.bind_no_auth")).toBe(false); - expect(findings.some((finding) => finding.checkId === "gateway.auth_no_rate_limit")).toBe( - false, - ); + const checkIds = findings.map((finding) => finding.checkId); + expect(checkIds).not.toContain("gateway.bind_no_auth"); + expect(checkIds).not.toContain("gateway.auth_no_rate_limit"); } } });