Skip to content

fix: resolve TypeScript type errors and add tsc check to CI#41

Merged
ChenNima merged 1 commit intomainfrom
fix/tsc-type-errors-and-ci-check
Mar 18, 2026
Merged

fix: resolve TypeScript type errors and add tsc check to CI#41
ChenNima merged 1 commit intomainfrom
fix/tsc-type-errors-and-ci-check

Conversation

@ChenNima
Copy link
Contributor

Summary

  • Fix all 27 tsc --noEmit type errors across 7 test files and 1 mock file
  • Add npx tsc --noEmit step to GitHub Actions CI workflow (runs after Prisma generate, before tests)

Changed files

File Change
.github/workflows/test.yml Add Type check step with npx tsc --noEmit
src/lib/__mocks__/prisma.ts Fix import: @prisma/client@/generated/prisma/client
src/lib/__tests__/api-handler.test.ts Cast process.env to bypass NODE_ENV read-only
src/lib/__tests__/auth.test.ts Add as unknown as UserAuthContext for agent mock values passed to getUserSessionFromRequest
src/lib/__tests__/cookie-utils.test.ts Use Record<string, string | undefined> alias for process.env mutations
src/lib/__tests__/event-bus.test.ts Add type assertions for messageHandler calls
src/services/__tests__/assignment.service.test.ts Remove userUuid/agentUuid properties not in AuthContext (12 occurrences)
src/services/__tests__/comment.service.test.ts Cast "unknown" to "task" for invalid TargetType test

Test plan

  • npx tsc --noEmit passes locally with 0 errors
  • CI workflow runs type check and tests successfully

Generated with Claude Code

…k to CI

- Fix PrismaClient import path in mock (use @/generated/prisma/client)
- Fix NODE_ENV read-only assignment in api-handler and cookie-utils tests
- Fix AgentAuthContext → UserAuthContext type mismatch in auth tests
- Fix never/null type inference in event-bus tests
- Remove non-existent userUuid/agentUuid properties from AuthContext in assignment tests
- Fix invalid TargetType literal in comment service test
- Add `npx tsc --noEmit` step to GitHub Actions CI workflow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 96.19% (🎯 95%) 1743 / 1812
🔵 Statements 95.14% (🎯 95%) 1881 / 1977
🔵 Functions 94.72% (🎯 93%) 377 / 398
🔵 Branches 86.99% (🎯 85%) 1177 / 1353
File CoverageNo changed files found.
Generated in workflow #49 for commit 4b4a8d2 by the Vitest Coverage Report Action

@ChenNima ChenNima merged commit 2b26c30 into main Mar 18, 2026
1 check passed
@ChenNima ChenNima deleted the fix/tsc-type-errors-and-ci-check branch March 18, 2026 02:49
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.

1 participant