Skip to content

chore: add typecheck:test script and document test typecheck and coverage - #1493

Merged
greatest0fallt1me merged 2 commits into
CalloraOrg:mainfrom
Opulencechuks:fix/typecheck-test-and-coverage
Nov 26, 2026
Merged

greatest0fallt1me merged 2 commits into
CalloraOrg:mainfrom
Opulencechuks:fix/typecheck-test-and-coverage

Conversation

@Opulencechuks

Copy link
Copy Markdown
Contributor

Closes #1420

## Summary

Adds a `typecheck:test` npm script to type-check test files against `tsconfig.test.json`, documents both `npm run typecheck:test` and `npm run test:coverage` in `CONTRIBUTING.md`, and provides the proposed `.github/workflows/ci.yml` update for the maintainer to apply separately.

## Changes

- **`package.json`**: Added `"typecheck:test": "tsc -p tsconfig.test.json --noEmit"`.
- **`CONTRIBUTING.md`**: Updated the Pull Request checklist and "Before opening a pull request" testing steps to include `npm run typecheck:test` and `npm run test:coverage`.
- No workflow files (`.github/workflows/ci.yml`) were modified in this PR.

## Proposed `.github/workflows/ci.yml` Change

For the maintainer to apply separately:

```diff
       - run: npm ci
       - run: npx tsc -p tsconfig.json --noEmit
+      - run: npm run typecheck:test
       - run: npm run build
-      - run: npx vitest run
+      - run: npm run test:coverage
+      - uses: actions/upload-artifact@v4
+        if: always()
+        with:
+          name: coverage-lcov
+          path: coverage/lcov.info

Existing typecheck:test Errors (For Follow-Up Scoping)

Running tsc -p tsconfig.test.json --noEmit locally currently reports 426 pre-existing type errors across 90 files (primarily TS2532 / noUncheckedIndexedAccess checks on array/query results in tests, unused imports TS6133, and union narrowing in fetchSpec.test.ts). Because the volume is large, these were not modified here so this PR stays focused.

Top files by error count:

  • src/utils/fetchSpec.test.ts (36)
  • src/pages/BillingHistory.test.tsx (33)
  • src/state/collectionsStore.test.tsx (33)
  • src/state/testCallHistory.test.ts (25)
  • src/components/CodeExample.test.tsx (25)
  • src/components/HealthTimeline.test.tsx (13)
  • src/services/AnalyticsService.test.ts (12)
  • src/pages/ReviewsTab.test.tsx (12)
  • src/pages/ApiUsage.test.tsx (12)
  • src/components/Toast.test.tsx (12)
  • src/components/VirtualizedCallHistory.test.tsx (10)
  • src/utils/diff.test.ts (10)
  • Plus 78 additional files with 1–9 errors each (including 9 non-test files surfaced under tsconfig.test.json: OpenAPIImport.tsx, WithdrawModal.tsx, ApiUsage.tsx, ApiDetailPage.tsx, HealthTimeline.tsx, CollectionsMenu.tsx, txSummary.ts, fetchSpec.ts, openapi-parse.client.ts, NotificationCenter.tsx).

Note: Enable - run: npm run typecheck:test in CI once the follow-up PR resolves these 426 pre-existing errors (or mark it continue-on-error: true initially).

Testing

  • Ran tsc -p tsconfig.test.json --noEmit locally to inventory existing test type errors.
  • npm run test:coverage and npm test -- --run src/coverage-config.test.ts to be verified in CI on Node 20.

@drips-wave

drips-wave Bot commented Nov 24, 2026

Copy link
Copy Markdown

@Opulencechuks Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

pr-malware-guard: resolved

No rules match the latest changes any more. Thank you!

@github-actions github-actions Bot added the needs-security-review Needs a maintainer security review (pr-malware-guard) label Nov 24, 2026
@github-actions github-actions Bot removed the needs-security-review Needs a maintainer security review (pr-malware-guard) label Nov 25, 2026
@greatest0fallt1me
greatest0fallt1me merged commit 8b67bf9 into CalloraOrg:main Nov 26, 2026
1 check passed
@greatest0fallt1me

Copy link
Copy Markdown
Contributor

Thanks @Opulencechuks! Merged. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run test typecheck and coverage in CI

2 participants