TypeScript Generate All Tests
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Bring an entire TypeScript codebase’s unit test coverage up to a minimum bar — 80% line coverage — in one pass: find every source file with no test at all or with measured coverage below the bar, then write or extend tests for each until it clears it. TypeScript/npm only; it never runs against, or falls back to, any other language.
Purpose
iru-typescript-generate-all-tests answers "bring this whole codebase’s test coverage up to a bar" rather than
"write tests for this one file/task," which is what iru-typescript-code-one-task and the iru-code pipeline
already handle per task. It explores the whole codebase to build an inventory of testable files across any
detected flavor (library, React, Angular, React Native, Ionic, or Hilla frontend), delegates to
iru-typescript-coverage for the exact, measured percentage per file, and only writes or extends test code — it
does not add license headers, TSDoc, or run a code-quality pass, and it only touches production source code when
a file is genuinely untestable as written (e.g. no seam to substitute a hard dependency), which it reports
explicitly rather than silently redesigning the module.
For React Native it also resolves the toolchain (expo in dependencies is expo, otherwise metro), the Jest preset
(jest-expo, @react-native/jest-preset or the legacy react-native preset) and the installed
@testing-library/react-native major, excludes the same native/config/entry files as iru-typescript-coverage so both
agree on the candidate set, and hands each test-writing agent a set of React Native rules: awaited render/fireEvent
on RNTL 14, Expo Router’s renderRouter for Expo screens, library Jest mocks for metro’s third-party native modules,
native code mocked at its JS boundary, fake timers for animations, and a stop-and-ask on transformIgnorePatterns failures.
For a web UI project with Playwright wired (React/Vite, Angular, Ionic, Next.js, Hilla) a further step (Step 6b)
generates UI tests per the catalog’s UI contract (see Building user interfaces)
for every existing screen and component that has none: one story per visual state, Playwright component specs through the
project’s component gallery, and screen specs against the built app, each capturing the .ui-quality.yml directions
(states x left-to-right/right-to-left x light/dark) into .ui-screenshots/ with an accessibility check. It creates the
shared support/ui-screenshots.ts helper when missing, asks before adding @axe-core/playwright, and never scaffolds
Playwright itself (no Playwright means "UI tests not generated"); React Native UI tests are left to
iru-react-native-code-one-task. Accessibility violations it finds are reported, not silently fixed.
When .ui-quality.yml says accessibility: none (opted out entirely) or off (rules apply, checks not run), accessibility checks are not applicable: they are skipped and reported as "accessibility: opted out" (none) or "accessibility checks off" (off) — never "unverified" and never a failure.
Plugin
Shipped by the iru-typescript plugin of the ai-catalog marketplace (install with /plugin install iru-typescript@ai-catalog; see Plugins).
Inputs
None — no arguments are accepted. It always scopes to the whole repository (or, in a workspaces/monorepo setup with no obvious single target, asks which workspace to scope the run to before continuing).
Outputs
-
New or extended test files for every source file found with no matching test file, or with line coverage below 80% — following this project’s detected flavor’s testing library (Vitest/Jest,
@testing-library/react,@testing-library/react-native(underjest-expoor@react-native/jest-preset), AngularTestBed, or Hilla Vitest browser mode) and its existing test-file convention (sibling.test/.spec, or a mirroredtest/tree). -
Occasionally, a minimal testability change to a module under test (e.g. accepting a dependency as a parameter, extracting a hook/service) — only when a file is genuinely untestable as written, and always called out explicitly rather than folded silently into "tests added."
-
For React Native, no silent dependency changes: when
@testing-library/react-nativeisn’t installed (the CLI template only shipsreact-test-renderer) it asks viaAskUserQuestionwhether to add it, and otherwise follows the existingreact-test-rendererstyle, noting that it is deprecated for React 19; atransformIgnorePatternschange is reported and asked about, never edited. -
A report: total candidate files found (and any excluded as having no testable logic), the detected flavor/test runner/package manager/test-file convention, how many already met the bar, before/after coverage per file touched, any file still below 80% after two extension attempts (with its exact remaining uncovered lines), and the full-suite test result.
-
For web UI projects: story files and Playwright component/screen specs for every uncovered screen and component, the
support/ui-screenshots.tshelper when absent, and screenshots under.ui-screenshots/<kind>/<Id>/; the report adds screens/components found and covered, states covered, screenshot count, accessibility violations (rule ids) at the.ui-quality.ymllevel, and anything left without UI tests or "unverified". -
No license headers, TSDoc, or code-quality fixes — those remain
iru-check-license,iru-typescript-tsdoc, and `iru-typescript-code-quality’s jobs.
Execution flow
Dependencies
Invokes
-
TypeScript Coverage — Step 3, and again in Step 6 to re-measure after generation: delegated through the
iru-gate-runneragent so its fulllcov.info/coverage HTML report never lands directly in this conversation, and so the whole suite runs once per batch rather than once per file. -
TypeScript Test — Step 6b (the
uiselector, to run the generated UI specs once) and Step 7, once, to confirm the full suite still passes after every file’s tests have been written or extended; also delegated throughiru-gate-runner.
Invoked by
None from inside this catalog — it is a top-level entry point invoked by a person who wants coverage brought up
across the whole codebase in one pass, independent of the /iru-code//iru-issue pipeline (which handles
per-task test-writing via iru-typescript-code-one-task).
Related agents
-
Explore— Step 2, to build the source-file/test-file inventory and detect the project’s flavor, test runner, package manager, and test convention without reading every file directly. -
iru-gate-runner— Steps 3, 6, 6b, and 7, to runiru-typescript-coverage/iru-typescript-testand report back only a compact summary instead of a raw coverage/test log. -
general-purpose(default, nosubagent_typenamed) — Step 5, one per file needing new/extended tests, dispatched concurrently since each only touches its own test file (Step 6b dispatches one per component/screen for UI tests the same way).
Source
SKILL.md on GitHub — the file this page was generated from.