Skip to content

chore: add CI workflow and controller tests#34

Merged
B4nan merged 1 commit intomasterfrom
chore/add-ci-and-tests
Mar 12, 2026
Merged

chore: add CI workflow and controller tests#34
B4nan merged 1 commit intomasterfrom
chore/add-ci-and-tests

Conversation

@B4nan
Copy link
Copy Markdown
Member

@B4nan B4nan commented Mar 12, 2026

Summary

  • Add vitest + SWC test setup with supertest-based CRUD tests for author and book controllers
  • Add GitHub Actions CI workflow running tests on Node.js 22 and 24
  • Fix several pre-existing issues: Publisher.ts TDZ (enum after class), zod param parsing (z.number()z.coerce.number() for string route params), and TypeScript type errors with koa-router Context and ctx.request.body
  • Export init promise and server handle from server.ts for proper test lifecycle management
  • Add .yarnrc.yml (node-modules linker), packageManager field, and test dependencies

Test plan

  • yarn build passes
  • yarn test passes (2 test files, 2 tests)
  • CI runs on push to master and PRs

🤖 Generated with Claude Code

- Add vitest with SWC for running tests with decorator support
- Add supertest-based CRUD tests for author and book controllers
- Add GitHub Actions CI workflow for Node 22/24
- Fix Publisher.ts TDZ issue by moving enum before class
- Fix zod param parsing to use z.coerce.number() for string route params
- Fix type errors in controllers (Context type, request.body typing)
- Export init promise and server from server.ts for test lifecycle
- Add .yarnrc.yml with node-modules linker
- Add packageManager field and test devDependencies to package.json
- Exclude spec files from tsconfig build, add skipLibCheck

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@B4nan B4nan merged commit a2cd9d0 into master Mar 12, 2026
2 checks passed
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