Skip to content

vendor-account-details.integration-spec.ts runs under no jest config and is counted as uncovered source #493

Description

@Omoboi-dev

Category: Testing & Quality
Difficulty: Medium

Description

PR #486 added an integration spec inside src/. It runs nowhere, and it distorts the coverage gate.

  • The default jest testRegex is (src|test)/.*\.spec\.ts$. The filename ends -spec.ts, not .spec.ts, so npm test and npm run test:cov skip it.
  • test/jest-integration.json uses testRegex: "test/integration/.*\\.integration-spec\\.ts$". The file is in src/vendor/, so npm run test:integration skips it too.
  • collectCoverageFrom is src/**/*.ts with !src/**/*.spec.ts. Again the hyphen means it is not excluded, so 44 lines of test code are counted as application source at 0% function coverage.

Every other integration spec in the repository lives in test/integration/. This is the only one that does not, and it is the only one that never executes.

Location

  • src/vendor/vendor-account-details.integration-spec.ts
  • test/jest-integration.json
  • package.json

Example commits

test(vendor): move the account details integration spec under test/integration
chore(jest): exclude -spec.ts files from coverage collection

Acceptance Criteria

  • The spec lives where the integration config picks it up, and npm run test:integration executes it.
  • The spec passes.
  • collectCoverageFrom excludes *-spec.ts as well as *.spec.ts.
  • coverage/coverage-summary.json no longer contains an entry for any spec file.
  • Tests are required. This issue is the tests.

Technical Notes

Check the relative imports after moving. Files under test/integration/ reach source via ../../src/....

While you are in package.json, the same hyphen problem means *.e2e-spec.ts files are also not excluded from collectCoverageFrom. They happen to live under test/ so they fall outside src/** today, but an exclusion glob covering both patterns is worth adding so a future move does not reintroduce this.

Out of scope: raising the coverage threshold.


Before you start

  • Set up with the steps in CONTRIBUTING.md. Node 22 is required (.nvmrc), use npm ci rather than npm install, and copy .env.example to .env before running npx prisma generate — the Prisma config reads DATABASE_URL at load.
  • Branch from dev and open your pull request against dev. main is the released baseline.
  • Tests that need an authenticated caller should use the bearer() helper in test/auth-helper.ts, which mints a genuinely signed SEP-10 token. Do not send a raw Stellar address as a bearer token; that path was removed deliberately.
  • You may cover more than one issue in a single pull request.

Metadata

Metadata

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