-
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
'use strict'; | ||
|
||
var expect = require('expect'); | ||
var path = require('path'); | ||
|
||
var runner = require('gulp-test-tools').gulpRunner; | ||
var headLines = require('gulp-test-tools').headLines; | ||
var eraseTime = require('gulp-test-tools').eraseTime; | ||
|
||
describe('flags: v8flags', function() { | ||
|
||
it('Should respawn by a v8flag: --lazy', function(done) { | ||
runner({ verbose: false }) | ||
.chdir(path.join(__dirname, 'fixtures/gulpfiles')) | ||
.gulp('--lazy') | ||
.run(cb); | ||
|
||
function cb(err, stdout, stderr) { | ||
expect(err).toEqual(null); | ||
expect(stderr).toEqual(''); | ||
|
||
var line = eraseTime(headLines(stdout, 1)); | ||
expect(line).toEqual('Node flags detected: --lazy'); | ||
|
||
line = eraseTime(headLines(stdout, 2, 1)); | ||
expect(line).toMatch('Respawned to PID: '); | ||
done(err); | ||
} | ||
}); | ||
|
||
it('Should respawn by v8flags: --lazy --harmony', function(done) { | ||
runner({ verbose: false }) | ||
.chdir(path.join(__dirname, 'fixtures/gulpfiles')) | ||
.gulp('--lazy --harmony') | ||
.run(cb); | ||
|
||
function cb(err, stdout, stderr) { | ||
expect(err).toEqual(null); | ||
expect(stderr).toEqual(''); | ||
|
||
var line = eraseTime(headLines(stdout, 1)); | ||
expect(line).toEqual('Node flags detected: --harmony, --lazy'); | ||
|
||
line = eraseTime(headLines(stdout, 2, 1)); | ||
expect(line).toMatch('Respawned to PID: '); | ||
done(err); | ||
} | ||
}); | ||
}); |