Test: Add claim lifecycle E2E test (#171)#266
Merged
phertyameen merged 1 commit intoJun 27, 2026
Merged
Conversation
Adds test/claim-lifecycle.e2e-spec.ts -- boots full NestJS AppModule against an embedded-postgres instance, mocks the Stellar-bound providers (SweepsService, TokenVerificationProvider, WebhooksService, ClaimAuditProvider) and background crons, seeds an Account in PENDING_CLAIM directly via TypeORM, then exercises POST /claims/verify, POST /claims/redeem, GET /claims/:id, double-redeem idempotency, and DTO rejection of bad destination/missing token.
Real Stellar testnet integration (the issue's literal 'verify destination received funds via Horizon' step) is deferred: the mocked SweepsService deliberately short-circuits Horizon. A follow-up issue should add a HORIZON_URL + STELLAR_SECRET gated testnet path.
Pre-existing infrastructure note: npm run test:e2e is currently failing on every .e2e-spec.ts file with a Jest ts-jest parse error ('Cannot use import statement outside a module'). The test/jest-e2e.json transform config does not pick up ts-jest correctly; that fix is OUT of scope of bridgelet-org#171. The minimum unblock is to add a ts-jest preset and extensionsToTreatAsEsm: ['.ts'] in test/jest-e2e.json (or equivalent).
|
@Alqku 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! 🚀 |
phertyameen
approved these changes
Jun 27, 2026
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.
Closes #171
Closes #166
What
New E2E test test/claim-lifecycle.e2e-spec.ts exercising:
Approach
Scope notes
npm run test:e2eis currently failing on every*.e2e-spec.tsfile (including the pre-existing test/app.e2e-spec.ts) withSyntaxError: Cannot use import statement outside a module. Thetest/jest-e2e.jsontransformer (^.+\\.(t|j)s$: ts-jest) does not pick up ts-jest correctly - the most likely minimum unblock is to add"preset": "ts-jest/presets/default-esm"and"extensionsToTreatAsEsm": [".ts"]to jest-e2e.json (or set up a ts-jest globals config). That fix is OUT of scope of this PR and should land before this test runs in CI. Until then,npm run test:e2e -- --testPathPattern=claim-lifecyclewill exit with the parse error unchanged.Testing
npx tsc --noEmit -p tsconfig.json-> clean for this filenpx eslint test/claim-lifecycle.e2e-spec.ts-> 0 errors (8 warnings remain, no-unsafe-argument on the supertestapp.getHttpServer()cast; matches the existing app.e2e-spec.ts pattern)npx prettier --check test/claim-lifecycle.e2e-spec.ts-> cleannpm run test:e2e -- --testPathPattern=claim-lifecycle-> currently blocked on pre-existing jest infra; will pass once the jest config is fixed (see scope note above)Branch
fix/issue-171-add-e2e-claim-lifecycle-test