@@ -107,7 +107,7 @@ export default class CoverageReporter extends BaseReporter {
107107 ) ;
108108 }
109109
110- this . _checkThreshold ( this . _globalConfig , map ) ;
110+ this . _checkThreshold ( map ) ;
111111 }
112112
113113 private async _addUntestedFiles (
@@ -209,11 +209,10 @@ export default class CoverageReporter extends BaseReporter {
209209 }
210210 }
211211
212- private _checkThreshold (
213- globalConfig : Config . GlobalConfig ,
214- map : istanbulCoverage . CoverageMap ,
215- ) {
216- if ( globalConfig . coverageThreshold ) {
212+ private _checkThreshold ( map : istanbulCoverage . CoverageMap ) {
213+ const { coverageThreshold} = this . _globalConfig ;
214+
215+ if ( coverageThreshold ) {
217216 function check (
218217 name : string ,
219218 thresholds : Config . CoverageThresholdValue ,
@@ -250,7 +249,7 @@ export default class CoverageReporter extends BaseReporter {
250249 PATH : 'path' ,
251250 } ;
252251 const coveredFiles = map . files ( ) ;
253- const thresholdGroups = Object . keys ( globalConfig . coverageThreshold ) ;
252+ const thresholdGroups = Object . keys ( coverageThreshold ) ;
254253 const groupTypeByThresholdGroup : { [ index : string ] : string } = { } ;
255254 const filesByGlob : { [ index : string ] : Array < string > } = { } ;
256255
@@ -342,7 +341,7 @@ export default class CoverageReporter extends BaseReporter {
342341 errors = errors . concat (
343342 check (
344343 thresholdGroup ,
345- globalConfig . coverageThreshold [ thresholdGroup ] ,
344+ coverageThreshold [ thresholdGroup ] ,
346345 coverage ,
347346 ) ,
348347 ) ;
@@ -357,7 +356,7 @@ export default class CoverageReporter extends BaseReporter {
357356 errors = errors . concat (
358357 check (
359358 thresholdGroup ,
360- globalConfig . coverageThreshold [ thresholdGroup ] ,
359+ coverageThreshold [ thresholdGroup ] ,
361360 coverage ,
362361 ) ,
363362 ) ;
@@ -370,7 +369,7 @@ export default class CoverageReporter extends BaseReporter {
370369 errors = errors . concat (
371370 check (
372371 fileMatchingGlob ,
373- globalConfig . coverageThreshold [ thresholdGroup ] ,
372+ coverageThreshold [ thresholdGroup ] ,
374373 map . fileCoverageFor ( fileMatchingGlob ) . toSummary ( ) ,
375374 ) ,
376375 ) ;
0 commit comments