Skip to main content

check_typescript

Function check_typescript 

Source
pub fn check_typescript(
    root: &Path,
    base: &str,
    exclude: &[String],
) -> Result<Vec<Uncovered>>
Expand description

Every line added or modified in root’s <base>...HEAD diff that the TypeScript unit suite (vitest) doesn’t cover, sorted for deterministic output. exclude is the coverage-rule exemptions (as in crate::coverage::measure_typescript) — an excluded file is left out of the run, so its changed lines are lifted.

The TypeScript twin of check (#135): reuses the same <base>...HEAD diff machinery (changed_lines), scoped to .ts / .tsx / .mts / .cts sources, and maps the changed lines against vitest’s per-file v8 coverage (crate::coverage::measure_patch_typescript). Returns early — with no coverage run — when the diff touches no TypeScript source, so a PR that changes only docs or other languages doesn’t pay for a measurement. Requires vitest + git; an unresolvable base surfaces as an error rather than a silent pass.