1 | ;
|
2 | var gutil = require('gulp-util');
|
3 |
|
4 | module.exports = function (cb, errorOnFail) {
|
5 | var failureCount = 0;
|
6 |
|
7 | this.specDone = function (result) {
|
8 | if (result.status === 'failed') {
|
9 | failureCount++;
|
10 | }
|
11 | };
|
12 |
|
13 | this.jasmineDone = function () {
|
14 | if (errorOnFail && failureCount > 0) {
|
15 | cb(new gutil.PluginError('gulp-jasmine', 'Tests failed', {
|
16 | showStack: false
|
17 | }));
|
18 | } else {
|
19 | cb();
|
20 | }
|
21 | };
|
22 | };
|