Closed nishanth83Ya closed 6 years ago
It looks like the variable result.success should also be checked. Some something like the following?
_jestCli2.default.runCLI(options, options.config.rootDir, function (result) { if (result.numFailedTests || result.numFailedTestSuites ) { cb(new _gulpUtil2.default.PluginError('gulp-jest', { message: 'Tests Failed' })); } else if(result.success == false) { console.log(result); cb(new _gulpUtil2.default.PluginError('gulp-jest', { message: 'Tests Failed due to coverage threshold breaches' })); } else { cb(); } });
Very interesting! Can you work on a pull request for that since you have almost everything there?
maybe ?
else if(!result.success) {
Is there any update on this issue? I also discovered it recently and I'd like to send a pull request to also check result.success in https://github.com/alansouzati/gulp-jest/blob/master/src/index.js#L14
I tried to commit so I can raise a pull request but ran into permission issues.
Hi guys,
I needed this for my own build pipeline for my own project, so I submitted a pull request to add this feature in. The code above would be a bit unreliable, so I added a check to make sure a coverage threshold was set.
Please see PR here: https://github.com/alansouzati/gulp-jest/pull/44
Cheers,
The coverage is still not failing has there been any updates on this ?
When the coverage threshold breaches, I don't see the gulp task failing. Can this be added please? As per the code snippet below only test failures fail the gulp task?
_jestCli2.default.runCLI(options, options.config.rootDir, function (result) { if (result.numFailedTests || result.numFailedTestSuites) { cb(new _gulpUtil2.default.PluginError('gulp-jest', { message: 'Tests Failed' })); } else { cb(); } });