Skip to content

ci: type-check test files in a dedicated tsc pass - #253

Merged
iamfj merged 1 commit into
nextfrom
issue-198
Jul 3, 2026
Merged

ci: type-check test files in a dedicated tsc pass#253
iamfj merged 1 commit into
nextfrom
issue-198

Conversation

@iamfj

@iamfj iamfj commented Jul 3, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Test files were excluded from tsconfig.json (to keep them out of dist/) and were therefore never type-checked by tsc. This adds a dedicated tsconfig.test.json plus a typecheck:test npm script, wired into CI, so type errors in tests now fail the build. Enabling the check surfaced pre-existing type errors in tests that had drifted from the code they exercise (the request() variables-argument signature, orderBy being a PaginationOrderBy string, and a nullable comment.user), which are fixed here.

Closes #198

Type of change

  • Bug fix
  • New feature
  • Refactor (no behavior change)
  • Documentation
  • Tests
  • Build / CI

Checklist

  • npm run check:ci passes (lint + format)
  • npx tsc --noEmit passes (type check)
  • npm test passes (unit tests)
  • New code has tests (happy path + primary error case)
  • Commit messages follow Conventional Commits

Testing

  • npm run typecheck:test — exit 0 (now covers 68 test files that were previously unchecked; fails on injected test type errors as expected)
  • npx tsc --noEmit — exit 0
  • npm run check:ci — exit 0
  • npm test — 829 tests passed across 60 files

Notes for reviewers

allowJs is enabled in tsconfig.test.json so the tests can import the plain-CommonJS release scripts (scripts/release/*.cjs) without a declaration file; noEmit keeps the pass check-only.

The build tsconfig excludes tests to keep them out of dist/, which left
test files entirely unchecked by tsc. Add tsconfig.test.json (extends the
base, noEmit, allowJs, includes src + tests) plus a `typecheck:test` npm
script, and run it as a new CI step so test type errors fail the build.

Enabling the check surfaced pre-existing type errors in tests that had
drifted from the code they exercise; fix them:
- graphql-client: adapt to request()'s current variables-argument signature
- initiative-service: orderBy is a PaginationOrderBy string, not an object
- issue-service: comment.user is nullable, use optional chaining

Closes #198
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

✅ knip — no dead code

No unused files, exports, types, or dependencies detected.

@iamfj
iamfj merged commit 4752391 into next Jul 3, 2026
12 checks passed
@iamfj
iamfj deleted the issue-198 branch July 3, 2026 07:23
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.

type-architecture: add real tsc type-checking for tests

1 participant