Conversation
- Include test directory in tsconfig.json for development with strict type checking - Create tsconfig.build.json that extends tsconfig.json but excludes tests and node_modules - Configure Next.js to use tsconfig.build.json for production builds via tsconfigPath property - Uncomment and enable test linting in eslint.config.mjs - Add eslint-plugin-jest to package.json for Jest-specific linting rules - Fix TypeScript errors in test files: - test/server/git/controller.test.ts: Cast fakeOctokitData to SyncReposSchema type - test/app.ts: Refactor to return Promise instead of using done callback - Fix ESLint errors in test files: - test/octomock/index.ts: Add disable comment for mock-specific any types, fix empty object types - test/app.test.ts: Replace any types with proper type assertions - test/app.ts: Replace any types with proper type assertions - All tests pass and build succeeds with both tsconfig configurations Fixes #411 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Open questions:
|
|
Addressing your open questions before I fully review:
I'm all for type checking being added, it's one of the main benefits of the language so we should make use of it and lift the code base up to that higher bar.
I'm fine with splitting them or leaving them together. It's a pretty minor change in my eyes. |
@riley-kohler Do you think that should be added in this PR or a follow-on? And should it go in the build workflow or somewhere else? |
I'll probably add a separate workflow and do it in a follow-on alongside the lint and format split change, since we'll need required statuses updated with both anyway. |
|
All of the open question changes sound like good follow ons to me. I think type checking should just be added to the npm build script so that it always runs locally and in the build workflow. Same for lint/format, I think the CI checks should just mirror the local commands. |
Summary
This PR implements the changes requested in #411 to add type checking and linting for test files.
Changes
Architecture Benefits
✅ Development: Tests included in type checking → catches bugs early
✅ Production builds: Tests excluded via tsconfig.build.json
✅ Code quality: Tests have same type safety and linting as production code
✅ Clean separation: Main tsconfig for dev/linting, tsconfig.build for builds
Testing
Fixes #411