Skip to Content

Coverage scanning

scanExpressCandidates(rootDir, options?)

Walks TypeScript sources under rootDir and collects Express route/middleware candidates.

ScanExpressCandidatesOptions

FieldDescription
getAllTsFilesOptionsSkip-dir overrides for discovery.
compilerOptionsExtra TS options merged over parsed tsconfig.json.
filesWhen set, restrict the program to these files only.
ownedRootsKeep only handlers whose declaration file lives under these roots (drops third-party middleware noise).

scanReachableServices(rootDir, options?)

ScanReachableServicesOptions

Extends ScanExpressCandidatesOptions with:

FieldDescription
maxNodesSafety bound to limit recursion depth during reachability analysis.

computeCoverageReport(options)

ComputeCoverageOptions

FieldDescription
scanRootsRequired array of directories to scan.
registrySnapshotRequired Record<string, RegistryEntry> at analysis time.
getAllTsFilesOptionsOptional discovery tweaks.
compilerOptionsOptional TS overrides.
maxServiceNodesOptional cap on work during service reachability.

CoverageReport

SectionContents
summaryCounts { total, wrapped, left } for middleware, controllers, and services.
leftArrays of CandidateRef still needing instrumentation for each bucket.
metascanRoots, filesScanned, generatedAt, protocolVersion, unresolvedHandlers, nodesVisited.

Embedded WebSocket clients can request a report with the COVERAGE_REQUEST message — see wire docs in the SDK repo.

See also