-
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update: Add flags.continue to config
- Loading branch information
Showing
8 changed files
with
114 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
'use strict'; | ||
|
||
var expect = require('expect'); | ||
var path = require('path'); | ||
var skipLines = require('gulp-test-tools').skipLines; | ||
var headLines = require('gulp-test-tools').headLines; | ||
var eraseTime = require('gulp-test-tools').eraseTime; | ||
var eraseLapse = require('gulp-test-tools').eraseLapse; | ||
|
||
var fixturesDir = path.join(__dirname, 'fixtures/config'); | ||
var runner = require('gulp-test-tools').gulpRunner({ verbose: false }).basedir(fixturesDir); | ||
|
||
describe('config: flags.continue', function() { | ||
|
||
it('Should continue if `flags.continue` is true in .gulp.*', | ||
function(done) { | ||
runner | ||
.chdir('flags/continue/t') | ||
.gulp() | ||
.run(cb); | ||
|
||
function cb(err, stdout, stderr) { | ||
expect(err).toNotEqual(null); | ||
|
||
stdout = eraseLapse(eraseTime(skipLines(stdout, 1))); | ||
expect(stdout).toEqual( | ||
'Starting \'default\'...\n' + | ||
'Starting \'err\'...\n' + | ||
'Starting \'next\'...\n' + | ||
'Finished \'next\' after ?\n' + | ||
'' | ||
); | ||
stderr = eraseLapse(eraseTime(headLines(stderr, 2))); | ||
expect(stderr).toEqual( | ||
'\'err\' errored after ?\n' + | ||
'Error: Error!' | ||
); | ||
done(); | ||
} | ||
}); | ||
|
||
it('Should not continue if `flags.continue` is false in .gulp.*', | ||
function(done) { | ||
runner | ||
.chdir('flags/continue/f') | ||
.gulp() | ||
.run(cb); | ||
|
||
function cb(err, stdout, stderr) { | ||
expect(err).toNotEqual(null); | ||
|
||
stdout = eraseLapse(eraseTime(skipLines(stdout, 1))); | ||
expect(stdout).toEqual( | ||
'Starting \'default\'...\n' + | ||
'Starting \'err\'...\n' + | ||
'' | ||
); | ||
stderr = eraseLapse(eraseTime(headLines(stderr, 2))); | ||
expect(stderr).toEqual( | ||
'\'err\' errored after ?\n' + | ||
'Error: Error!' | ||
); | ||
done(); | ||
} | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"flags": { | ||
"continue": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
|
||
var gulp = require('gulp'); | ||
|
||
function err(done) { | ||
done(new Error('Error!')); | ||
} | ||
|
||
function next(done) { | ||
done(); | ||
} | ||
|
||
gulp.task('default', gulp.series(err, next)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"flags": { | ||
"continue": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
|
||
var gulp = require('gulp'); | ||
|
||
function err(done) { | ||
done(new Error('Error!')); | ||
} | ||
|
||
function next(done) { | ||
done(); | ||
} | ||
|
||
gulp.task('default', gulp.series(err, next)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters