fix(coverage): don't panic if all covered files are ignored via directive (#29250)

Closes https://github.com/denoland/deno/issues/29218
This commit is contained in:
Bartek Iwańczuk 2025-05-12 02:47:32 +02:00 committed by GitHub
parent 5ab029db22
commit 2fe200f6ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 30 additions and 1 deletions

View file

@ -740,6 +740,12 @@ pub fn cover_files(
}
}
// All covered files, might have had ignore directive and we can end up
// with no reports at this point.
if file_reports.is_empty() {
return Err(anyhow!("No covered files included in the report"));
}
for reporter in reporters {
reporter.done(&coverage_root, &file_reports);
}