TypeScript Coverage
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Run the project’s TypeScript/JavaScript test runner — Vitest, Jest, or Angular’s ng test — with coverage
enabled, then read the exact percentages from the generated coverage/coverage-summary.json (falling back to
coverage/lcov.info when the summary is missing or a specific file isn’t in it). This is a read-only reporting
skill: it measures and reports coverage, it does not add tests or modify source/test code unless asked to as an
explicit follow-up. It also recognizes NestJS, Next.js and React Native projects, adjusting which suite is measured and which
files are excluded.
Purpose
iru-typescript-coverage answers "does file X meet the coverage bar?" with an exact, report-derived percentage
instead of an eyeballed guess from a runner’s console output. It reuses iru-typescript-test’s selector syntax to
scope which tests run, infers or accepts explicit target files, and — for files under the bar — points to the
exact uncovered line ranges (collapsed from consecutive `DA:<line>,0 records in lcov.info) so a follow-up can
target them precisely.
Framework awareness (detected from package.json, on top of the runner detection):
-
NestJS (
@nestjs/core) — measures the unit suite only (the default Vitest or Jest config, never the e2e config, which boots the app and often needs Docker), excludes pure wiring files (*.module.ts,src/main.ts) and generated code insidesrc/(for example a Prisma client) unless the project’s own coverage config includes them, and says so in the report. -
Next.js (
next) — measures Vitest (v8 provider) or Jest (vianext/jest) coverage only; Playwright end-to-end tests are never run or counted. Include globs target the app’s own source, and a Server Component that cannot be rendered in a unit test is reported as "only reachable through e2e" rather than as an untested file. -
React Native (
react-nativeorexpo; toolchainexpowhenexpois a dependency, otherwisemetro) — always Jest’s built-in coverage (jest-expo,@react-native/jest-presetor the legacyreact-nativepreset). Because neither scaffold setscollectCoverageFrom, every run adds exclusions after the include glob:android/,ios/,.expo/,coverage/,e2e/,.d.ts,.config.,.*rc., the rootindex.{js,ts}registration entry, test files and CodegenNative*.tsspecs, and says so in the report. Maestro/Detox device e2e is never run or counted; a screen reachable only through a device flow is reported as "only reachable through device e2e".
Plugin
Shipped by the iru-typescript plugin of the ai-catalog marketplace (install with /plugin install iru-typescript@ai-catalog; see Plugins).
Inputs
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
A file path, a directory, or a name pattern — the same selector syntax as the |
None — omitting it runs the whole suite and reports whole-project coverage. |
Outputs
-
A plain-text summary in the conversation — never a written file.
-
Per target file: exact line and branch coverage percentages (and functions, when relevant), computed directly from
coverage/coverage-summary.json(orcoverage/<project-name>/coverage-summary.jsonfor Angular CLI) — never estimated. -
If the user gave a coverage bar (e.g. "at least 80%"): a clear statement of whether each file/the total meets it.
-
For files under the bar: uncovered line ranges collapsed from
lcov.info’s `DA:records (e.g.src/math.ts: lines 66.66% — uncovered: 11, 17). -
For NestJS, Next.js and React Native, a note of which wiring files, native trees, config files or generated code were excluded and which suites were deliberately not measured (e2e, Playwright, Maestro/Detox).
-
"Coverage not wired" (naming the missing package/config, e.g.
@vitest/coverage-v8) instead of a false 0%/100% when the coverage provider isn’t installed. -
A file that has zero tests is forced into the report at 0% (via the runner’s include flag), not silently omitted.
-
No source or test code is ever modified, and coverage is never re-run to try to raise a number.
Execution flow
Dependencies
Invokes
None — iru-typescript-coverage is a leaf skill; it only runs the project’s test runner and reads the generated
coverage reports, it does not call any other skill in this catalog.
Invoked by
-
TypeScript Code One Task Group — Step 3.4, once per task group, via the
iru-gate-runneragent, to check every changed/new file in the group against the coverage bar. -
TypeScript Generate All Tests — Steps 3 and 6, via
iru-gate-runner, to measure coverage before and after generating tests. -
NestJS Code One Task Group — Step 3.5, 80% unit-only coverage gate, via the
iru-gate-runneragent. -
Next.js Code One Task Group — Step 3.4, unit-only 80% coverage gate, via the
iru-gate-runneragent. -
React Native Code One Task Group — Step 3.4, 80% gate measured from Jest unit tests alone, via the
iru-gate-runneragent.
Related agents
-
iru-gate-runner— bothiru-typescript-code-one-task-groupandiru-typescript-generate-all-testsalways invoke this skill from inside airu-gate-runnersub-agent they spawn, not inline.
Source
SKILL.md on GitHub — the file this page was generated from.