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
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.
Category: Testing & Quality
Difficulty: Medium
Description
PR #486 added an integration spec inside
src/. It runs nowhere, and it distorts the coverage gate.testRegexis(src|test)/.*\.spec\.ts$. The filename ends-spec.ts, not.spec.ts, sonpm testandnpm run test:covskip it.test/jest-integration.jsonusestestRegex: "test/integration/.*\\.integration-spec\\.ts$". The file is insrc/vendor/, sonpm run test:integrationskips it too.collectCoverageFromissrc/**/*.tswith!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.tstest/jest-integration.jsonpackage.jsonExample commits
Acceptance Criteria
npm run test:integrationexecutes it.collectCoverageFromexcludes*-spec.tsas well as*.spec.ts.coverage/coverage-summary.jsonno longer contains an entry for any spec file.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.tsfiles are also not excluded fromcollectCoverageFrom. They happen to live undertest/so they fall outsidesrc/**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
.nvmrc), usenpm cirather thannpm install, and copy.env.exampleto.envbefore runningnpx prisma generate— the Prisma config readsDATABASE_URLat load.devand open your pull request againstdev.mainis the released baseline.bearer()helper intest/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.