Problem
The repository has zero tests. There is no way to verify that a refactor (for example, the env-var work in the configurable-port-and-CORS issue) hasn't broken the API contract, and no regression test pinned to the existing auth bug (#3).
Scope
- Add a test runner (
vitest or jest).
- Add a small
supertest-based suite covering at minimum:
- Run tests against a local Postgres seeded from
setup/test_seed.sql, or stub Sequelize for unit-level coverage.
- Wire
npm test to invoke the suite.
Acceptance criteria
Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/1654/
Problem
The repository has zero tests. There is no way to verify that a refactor (for example, the env-var work in the configurable-port-and-CORS issue) hasn't broken the API contract, and no regression test pinned to the existing auth bug (#3).
Scope
vitestorjest).supertest-based suite covering at minimum:GET /v1/customer/:id— 200 on a valid record, 404 on missing, 401 (or whatever the spec says) whenauthKeyis missing.GET /v1/customer/bycompany/:id— equivalent shape coverage, including a regression test pinned to the auth bug fix from Broken Authentication in GET endpoint /v1/customer/bycompany/# #3.setup/test_seed.sql, or stub Sequelize for unit-level coverage.npm testto invoke the suite.Acceptance criteria
npm testruns and exits 0 on a healthy checkout.Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/1654/