Skip to content

test: cover usage recording paths#239

Open
pq198363-ops wants to merge 1 commit into
Agentpay-Org:mainfrom
pq198363-ops:bounty-98-usage-recording-tests
Open

test: cover usage recording paths#239
pq198363-ops wants to merge 1 commit into
Agentpay-Org:mainfrom
pq198363-ops:bounty-98-usage-recording-tests

Conversation

@pq198363-ops

Copy link
Copy Markdown

Summary

  • add dedicated usage recording coverage in src/usage.test.ts
  • cover first-write, accumulation, read-back, and unseen-pair zero behavior
  • cover deterministic saturation at Number.MAX_SAFE_INTEGER
  • cover disabled-service 409 service_disabled without increasing the usage total
  • assert the standard 400 invalid_request shape with message and requestId across validation failures

Closes #98

Validation

  • npx prettier --check src/usage.test.ts
  • npm run lint
  • git diff --check
  • npm run build
  • $env:NODE_ENV='test'; node --test dist/usage.test.js (16 tests, 1 suite)
  • clean dist, then npm run build
  • $env:NODE_ENV='test'; node --test dist/*.test.js dist/**/*.test.js (105 tests, 11 suites)

Notes

This is intentionally test-only. The focused suite did not expose a production behavior bug.

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 test coverage for usage recording, accumulation, saturation, and the disabled guard

1 participant