From e12ede57bcd8447161b600627e86b0218ad6ac75 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 30 Oct 2025 05:46:19 +0000 Subject: [PATCH] Fix TypeScript implicit any type errors in tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add explicit type annotations to newApplications: undefined in test cases to resolve TS7018 errors. TypeScript cannot infer the type from undefined alone, so we explicitly annotate it as 'string[] | undefined'. Fixes: - Line 279: Added 'as string[] | undefined' to newApplications property - Line 716: Added 'as string[] | undefined' to newApplications property This resolves the test suite compilation errors while maintaining the backward compatibility test coverage for optional newApplications field. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../services/domain/risk-insights-type-guards.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/domain/risk-insights-type-guards.spec.ts b/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/domain/risk-insights-type-guards.spec.ts index 7475c669032..0ee038a06aa 100644 --- a/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/domain/risk-insights-type-guards.spec.ts +++ b/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/domain/risk-insights-type-guards.spec.ts @@ -276,7 +276,7 @@ describe("Risk Insights Type Guards", () => { totalCriticalMemberCount: 4, totalCriticalAtRiskMemberCount: 1, totalCriticalAtRiskApplicationCount: 1, - newApplications: undefined, + newApplications: undefined as string[] | undefined, }; expect(() => validateOrganizationReportSummary(validData)).not.toThrow(); @@ -713,7 +713,7 @@ describe("Risk Insights Type Guards", () => { totalCriticalMemberCount: 4, totalCriticalAtRiskMemberCount: 1, totalCriticalAtRiskApplicationCount: 1, - newApplications: undefined, + newApplications: undefined as string[] | undefined, }; expect(isOrganizationReportSummary(validData)).toBe(true); });