test(services): add full CRUD and bulk endpoint coverage (#42)#62
Merged
mikewheeleer merged 1 commit intoJun 19, 2026
Merged
Conversation
…g#42) - Add src/services.test.ts: 39 tests covering POST/GET/DELETE services, PATCH price, PATCH disabled, PUT/GET metadata, and POST /services/bulk. Happy path, upsert, 404, and validation-error cases for every endpoint. - Fix ERR_HTTP_HEADERS_SENT in Server-Timing middleware: guard res.setHeader() with !res.headersSent check; the finish event fires after the response has already been written. - Fix npm test script: use 'dist/**/*.test.js' glob so node --test discovers health.test.js and services.test.js; set NODE_ENV=test so the in-process rate limiter is bypassed during test runs. - Fix npm run lint: remove --ext .ts flag (ESLint v9 flat-config does not accept it; file patterns are declared in eslint.config.js). All 60 tests pass (21 health + 39 services). Lint clean.
Contributor
|
this is exactly the coverage #42 was after — CRUD and the bulk endpoints all exercised properly. lgtm 🙌 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add src/services.test.ts: 39 tests covering POST/GET/DELETE services, PATCH price, PATCH disabled, PUT/GET metadata, and POST /services/bulk. Happy path, upsert, 404, and validation-error cases for every endpoint.
Fix ERR_HTTP_HEADERS_SENT in Server-Timing middleware: guard res.setHeader() with !res.headersSent check; the finish event fires after the response has already been written.
Fix npm test script: use 'dist/**/*.test.js' glob so node --test discovers health.test.js and services.test.js; set NODE_ENV=test so the in-process rate limiter is bypassed during test runs.
Fix npm run lint: remove --ext .ts flag (ESLint v9 flat-config does not accept it; file patterns are declared in eslint.config.js).
All 60 tests pass (21 health + 39 services). Lint clean.
closes #42