Problem
tsconfig.json has:
So tests/ — including the whole tests/integration/ suite — is never typechecked. npm run build and tsc --noEmit can both be clean while integration tests are broken at the type level.
How it surfaced
In #159 (PR #169) the IndexerState primary key changed from a singleton id to network. tsc --noEmit reported 0 errors and all 270 unit tests passed, while six integration suites failed at setup:
PrismaClientValidationError
FAIL tests/integration/api.test.ts
FAIL tests/integration/e2e.test.ts
FAIL tests/integration/migrations.test.ts
FAIL tests/integration/reorg-rollover.test.ts
FAIL tests/integration/reorg.test.ts
FAIL tests/integration/ws.test.ts
Cause: three call sites still used the removed key.
prisma.indexerState.create({ data: { id: 1, lastIndexedLedger: 101 } })
prisma.indexerState.findUnique({ where: { id: 1 } })
A typecheck covering tests/ would have caught all three instantly. Instead they were only found by running the integration job — which needs Postgres and a live API, so it does not run locally for most contributors.
This is a schema-change trap specifically: any future Prisma model change has the same blind spot.
Why the one-line fix does not work
Adding tests/**/* to include fails, because compilerOptions.rootDir is "src":
error TS6059: File 'tests/integration/api.test.ts' is not under rootDir 'src'.
rootDir controls the dist/ layout, so it cannot simply be widened without changing build output.
Suggested approach
Add a separate typecheck-only config that does not participate in the build:
then wire it into CI, e.g. "typecheck": "tsc --noEmit -p tsconfig.test.json", run alongside the existing build.
Expect some pre-existing errors in tests/ on the first run — those should be fixed (or narrowly suppressed with a comment) as part of this, otherwise the new check lands red and gets ignored.
Acceptance criteria
Drips Wave · Complexity: Easy · 100 points
Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk
Problem
tsconfig.jsonhas:So
tests/— including the wholetests/integration/suite — is never typechecked.npm run buildandtsc --noEmitcan both be clean while integration tests are broken at the type level.How it surfaced
In #159 (PR #169) the
IndexerStateprimary key changed from a singletonidtonetwork.tsc --noEmitreported 0 errors and all 270 unit tests passed, while six integration suites failed at setup:Cause: three call sites still used the removed key.
A typecheck covering
tests/would have caught all three instantly. Instead they were only found by running the integration job — which needs Postgres and a live API, so it does not run locally for most contributors.This is a schema-change trap specifically: any future Prisma model change has the same blind spot.
Why the one-line fix does not work
Adding
tests/**/*toincludefails, becausecompilerOptions.rootDiris"src":rootDircontrols thedist/layout, so it cannot simply be widened without changing build output.Suggested approach
Add a separate typecheck-only config that does not participate in the build:
then wire it into CI, e.g.
"typecheck": "tsc --noEmit -p tsconfig.test.json", run alongside the existing build.Expect some pre-existing errors in
tests/on the first run — those should be fixed (or narrowly suppressed with a comment) as part of this, otherwise the new check lands red and gets ignored.Acceptance criteria
tests/**/*is typechecked by some configdist/is unchanged (no test files emitted){ id: 1 }→{ network: 'testnet' }fix intests/integration/setup.tsmakes the new check fail (confirms it actually catches this class)Drips Wave · Complexity: Easy · 100 points
Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk