Skip to content

EscrowRepository is 54% covered and is the only path to the database #458

Description

@Omoboi-dev

Category: Testing & Quality
Difficulty: Medium

Description:
Per the repository pattern the specification mandates, every escrow read and write goes through this file.

Current coverage: 54.05% lines, 51.72% functions, 64% branches.

Around half its methods have never run under test, including several state transitions and the cache invalidation on every write.

Location:
src/escrow/escrow.repository.ts

Example commits:

test(escrow): cover the untested paths in escrow.repository.ts

Acceptance Criteria:

  • Every public method has at least one test
  • A test per state transition asserting the new state and the timestamp it sets
  • A test asserts cache invalidation fires on every write path
  • A test asserts markAutoReleaseSubmitting returns null when already claimed
  • Line coverage on this file is above 80%
  • npm run test:cov passes and overall coverage stays at or above 70%
  • npm run lint:check reports no new errors

Technical Notes:
Read the implementation before writing assertions and test what it does, not what you assume. If you find behaviour that looks wrong, say so in the pull request rather than silently changing it.


Before you start

  • Setup: CONTRIBUTING.md → Development Setup. Use Node 22 (nvm use), run npm ci rather than npm install, and run npx prisma generate after installing.
  • Tests that authenticate: use bearer() from test/auth-helper.ts. Sending a bare Stellar address as a bearer token returns 401. See Writing Tests That Need Authentication.
  • Branch from the latest dev and open your pull request against dev, not main. dev is the default branch; main is the released baseline.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcomplexity: medium150 pts. New endpoint, service method, integration testtestadd test

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions