Skip to content

test(services): add full CRUD and bulk endpoint coverage (#42)#62

Merged
mikewheeleer merged 1 commit into
Agentpay-Org:mainfrom
ZuLu0890:feat/issue-42-services-test-coverage
Jun 19, 2026
Merged

test(services): add full CRUD and bulk endpoint coverage (#42)#62
mikewheeleer merged 1 commit into
Agentpay-Org:mainfrom
ZuLu0890:feat/issue-42-services-test-coverage

Conversation

@ZuLu0890

Copy link
Copy Markdown
Contributor
  • 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

…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.
@mikewheeleer

Copy link
Copy Markdown
Contributor

this is exactly the coverage #42 was after — CRUD and the bulk endpoints all exercised properly. lgtm 🙌

@mikewheeleer mikewheeleer merged commit 728c8c3 into Agentpay-Org:main Jun 19, 2026
1 check failed
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.

Add full test coverage for the services CRUD and bulk endpoints

2 participants