refactor: extract API route test harness #381

Merged
barrettruth merged 1 commit from issue-366-api-route-test-harness into main 2026-05-12 13:05:36 +00:00
Owner

Problem

  • API route tests repeated DB/auth/encryption/request JSON setup.

Solution

  • Added tests/api/helpers.ts for shared API route DB/auth/encryption setup and request/response helpers.
  • Migrated geocode, NLP parse recurrence, settings NLP, and settings integrations route tests.
  • Kept route-specific assertions in the individual tests.

Verification

  • nix develop --command pnpm vitest run tests/api/geocode.test.ts tests/api/nlp-parse-recurrence.test.ts tests/api/settings-nlp.test.ts tests/api/settings-integrations.test.ts --reporter=verbose
  • nix develop --command pnpm vitest run tests/api --reporter=verbose
  • nix develop --command just lint
  • nix develop --command just test
  • nix develop --command just build

Closes #366

Problem - API route tests repeated DB/auth/encryption/request JSON setup. Solution - Added tests/api/helpers.ts for shared API route DB/auth/encryption setup and request/response helpers. - Migrated geocode, NLP parse recurrence, settings NLP, and settings integrations route tests. - Kept route-specific assertions in the individual tests. Verification - nix develop --command pnpm vitest run tests/api/geocode.test.ts tests/api/nlp-parse-recurrence.test.ts tests/api/settings-nlp.test.ts tests/api/settings-integrations.test.ts --reporter=verbose - nix develop --command pnpm vitest run tests/api --reporter=verbose - nix develop --command just lint - nix develop --command just test - nix develop --command just build Closes #366
refactor: extract API route test harness
All checks were successful
quality / Test (pull_request) Successful in 16s
quality / Lint (pull_request) Successful in 21s
quality / Build (pull_request) Successful in 43s
105867c85f
barrettruth force-pushed issue-366-api-route-test-harness from 105867c85f
All checks were successful
quality / Test (pull_request) Successful in 16s
quality / Lint (pull_request) Successful in 21s
quality / Build (pull_request) Successful in 43s
to 9288fa2570
All checks were successful
quality / Test (pull_request) Successful in 17s
quality / Lint (pull_request) Successful in 22s
quality / Build (pull_request) Successful in 43s
2026-05-12 12:57:47 +00:00
Compare
barrettruth force-pushed issue-366-api-route-test-harness from 105867c85f
All checks were successful
quality / Test (pull_request) Successful in 16s
quality / Lint (pull_request) Successful in 21s
quality / Build (pull_request) Successful in 43s
to 9288fa2570
All checks were successful
quality / Test (pull_request) Successful in 17s
quality / Lint (pull_request) Successful in 22s
quality / Build (pull_request) Successful in 43s
2026-05-12 12:58:42 +00:00
Compare
barrettruth deleted branch issue-366-api-route-test-harness 2026-05-12 13:05:36 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
barrettruth/delta!381
No description provided.