You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In typescript, I import NYC from 'nyc', and generate report, check code coverage programmatically.
new NYC().checkCoverage(coverageThresholds) should have option to throw error at end, instead of just purely console.error
this is my example code:
importNYCfrom'nyc';//"nyc": "^15.1.0",try{constnycOutput=join(__dirname,'.','.nyc_output');constnycInstance=newNYC({cwd: join(__dirname,'.'),reportDir: `coverage-e2e`,reporter: ['lcov','json','text-summary'],});awaitnycInstance.checkCoverage(coverageThresholds);awaitnycInstance.report();awaitfs.rm(nycOutput,{recursive: true,force: true});}catch(e){// NYC doesn't throw error when coverage is not met. bugconsole.error('Insufficient playwright code coverage!');}
Observed Behavior
checkCoverage() only set process.exitCode = 1 when insufficient coverage met, but in my use case, process is not passed into NYC class.
Troubleshooting steps
still occurring when I put cache: false in my nyc config
Environment Information
# paste the output here
The text was updated successfully, but these errors were encountered:
Expected Behavior
In typescript, I import NYC from 'nyc', and generate report, check code coverage programmatically.
new NYC().checkCoverage(coverageThresholds) should have option to throw error at end, instead of just purely console.error
this is my example code:
Observed Behavior
checkCoverage() only set process.exitCode = 1 when insufficient coverage met, but in my use case, process is not passed into NYC class.
Troubleshooting steps
cache: false
in my nyc configEnvironment Information
The text was updated successfully, but these errors were encountered: