Skip to content

fix(#58,#68): pre-commit hooks docs + concurrent request tests#431

Merged
Smartdevs17 merged 2 commits into
Smartdevs17:mainfrom
devJaja:fix/issues-58-68-husky-concurrent-tests
Jun 1, 2026
Merged

fix(#58,#68): pre-commit hooks docs + concurrent request tests#431
Smartdevs17 merged 2 commits into
Smartdevs17:mainfrom
devJaja:fix/issues-58-68-husky-concurrent-tests

Conversation

@devJaja

@devJaja devJaja commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #58
Closes #68


Issue #58 — Pre-commit hooks (Husky + lint-staged)

  • Root package.json has husky and lint-staged declared and wired up
  • .husky/pre-commit runs npx lint-staged on every commit
  • lint-staged runs ESLint + Prettier format check + TypeScript on staged api/src/**/*.ts and oracle/src/**/*.ts; cargo check on staged contract/**/*.rs
  • Added Section 4 (Pre-commit Hooks) to CONTRIBUTING.md documenting what runs, setup (npm install), and bypass (git commit --no-verify)

Issue #68 — Concurrent request handling tests

Added Concurrent Request Handling describe block to integration.test.ts with 5 tests asserting real behavior — no catch-all status assertions:

Test Assertion
Simultaneous deposits buildUnsignedTransaction called exactly N times — no merging
Concurrent submits submitTransaction + monitorTransaction each called exactly N times
Idempotency deduplication 5 concurrent requests with same key → submitTransaction called once
User isolation Concurrent requests from different users use correct addresses
Partial failure isolation One failure does not affect remaining successful requests

Also fixed pre-existing bugs blocking the test suite:

  • jest.config.js: moduleNameMappingmoduleNameMapper (typo broke @/ path aliases)
  • Added missing deps cls-hooked and uuid (required by requestId middleware)

Testing

cd api && npm test -- --testPathPattern=integration --no-coverage
# Tests: 44 passed, 44 total

Note: requestId.test.ts has 2 pre-existing failures on main unrelated to this PR.

…current request tests

Issue Smartdevs17#58 - Pre-commit hooks (Husky + lint-staged):
- husky and lint-staged already declared in root package.json
- .husky/pre-commit runs npx lint-staged on staged .ts files
- Added Section 4 to CONTRIBUTING.md documenting what runs on commit,
  setup steps, and --no-verify bypass instructions

Issue Smartdevs17#68 - Concurrent request handling tests:
- Added 'Concurrent Request Handling' describe block to integration.test.ts
  with 5 tests asserting real concurrent behavior:
  * simultaneous deposits processed independently (no merging)
  * concurrent submits without double-processing
  * idempotency key deduplication under concurrency
  * per-user isolation across concurrent requests
  * partial failure isolation (one failure doesn't affect others)
- Fixed pre-existing jest.config.js typo: moduleNameMapping -> moduleNameMapper
- Added missing runtime deps: cls-hooked, uuid (required by requestId middleware)
- All 44 integration tests pass
@vercel

vercel Bot commented Jun 1, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the smartdevs17's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 1, 2026

Copy link
Copy Markdown

@devJaja Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Smartdevs17 Smartdevs17 merged commit 13a24e9 into Smartdevs17:main Jun 1, 2026
3 of 13 checks passed
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.

Fix: Add concurrent request handling tests that actually assert behavior Add pre-commit hooks with Husky and lint-staged

2 participants