66 */
77import fs from 'fs' ;
88import type { CoverageSummary } from 'istanbul-lib-coverage' ;
9- import report from 'istanbul-lib-report' ;
9+ import { ReportBase , type ContextOptions , type ReportNode , type Watermarks } from 'istanbul-lib-report' ;
1010
1111/**
1212 * Determines if the coverage summary has full coverage
@@ -23,7 +23,7 @@ function isFull(metrics: CoverageSummary) {
2323/**
2424 * Determines the uncovered lines
2525 */
26- function getUncoveredLines ( node : report . ReportNode ) {
26+ function getUncoveredLines ( node : ReportNode ) {
2727 if ( node . isSummary ( ) ) {
2828 return [ ] ;
2929 }
@@ -77,12 +77,12 @@ interface ResultObject {
7777/**
7878 * A Vitest coverage reporter that writes to the Github Actions summary
7979 */
80- export default class GithubActionsCoverageReporter extends report . ReportBase {
80+ export default class GithubActionsCoverageReporter extends ReportBase {
8181 private readonly skipEmpty : boolean ;
8282 private readonly skipFull : boolean ;
8383 private readonly results : Record < string , ResultObject > = { } ;
8484 private cw : fs . WriteStream | null = null ;
85- private watermarks : Partial < report . Watermarks > | null = null ;
85+ private watermarks : Partial < Watermarks > | null = null ;
8686
8787 constructor ( opts : any ) {
8888 super ( opts ) ;
@@ -91,7 +91,7 @@ export default class GithubActionsCoverageReporter extends report.ReportBase {
9191 this . skipFull = Boolean ( opts . skipFull ) ;
9292 }
9393
94- onStart ( _node : any , context : report . ContextOptions ) {
94+ onStart ( _node : any , context : ContextOptions ) {
9595 if ( ! process . env . GITHUB_STEP_SUMMARY ) {
9696 console . log ( 'Reporter not being executed in Github Actions environment' ) ;
9797 return ;
@@ -108,7 +108,7 @@ export default class GithubActionsCoverageReporter extends report.ReportBase {
108108 this . cw . write ( '</tr></thead><tbody>' ) ;
109109 }
110110
111- onSummary ( node : report . ReportNode ) {
111+ onSummary ( node : ReportNode ) {
112112 const nodeName = node . getRelativeName ( ) || 'All Files' ;
113113 const rawMetrics = node . getCoverageSummary ( false ) ;
114114 const isEmpty = rawMetrics . isEmpty ( ) ;
@@ -129,11 +129,11 @@ export default class GithubActionsCoverageReporter extends report.ReportBase {
129129 } ;
130130 }
131131
132- onDetail ( node : report . ReportNode ) {
132+ onDetail ( node : ReportNode ) {
133133 return this . onSummary ( node ) ;
134134 }
135135
136- private formatter ( pct : number , watermark : keyof report . Watermarks ) {
136+ private formatter ( pct : number , watermark : keyof Watermarks ) {
137137 if ( ! this . watermarks || this . watermarks [ watermark ] === undefined ) return `<td>${ pct } %</td>` ;
138138 const [ low , high ] = this . watermarks [ watermark ] ;
139139
0 commit comments