-
-
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.
New: Support
flags.nodeFlags
config option
- Loading branch information
Showing
8 changed files
with
101 additions
and
1 deletion.
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
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,70 @@ | ||
'use strict'; | ||
|
||
var expect = require('expect'); | ||
var path = require('path'); | ||
|
||
var fixturesDir = path.join(__dirname, 'fixtures/config'); | ||
|
||
var runner = require('gulp-test-tools').gulpRunner().basedir(fixturesDir); | ||
var headLines = require('gulp-test-tools').headLines; | ||
var eraseTime = require('gulp-test-tools').eraseTime; | ||
|
||
describe('config: nodeFlags', function() { | ||
|
||
it('Should respawn by a node flag: --lazy', function(done) { | ||
runner | ||
.chdir('flags/nodeFlags/string') | ||
.gulp() | ||
.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 a node flag: --lazy --trace-deprecation', function(done) { | ||
runner | ||
.chdir('flags/nodeFlags/array') | ||
.gulp() | ||
.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, --trace-deprecation'); | ||
|
||
line = eraseTime(headLines(stdout, 2, 1)); | ||
expect(line).toMatch('Respawned to PID: '); | ||
done(err); | ||
} | ||
}); | ||
|
||
it('Should respawn with flags in config file and command line', function(done) { | ||
runner | ||
.chdir('flags/nodeFlags/string') | ||
.gulp('--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: --lazy, --harmony'); | ||
|
||
line = eraseTime(headLines(stdout, 2, 1)); | ||
expect(line).toMatch('Respawned to PID: '); | ||
done(err); | ||
} | ||
}); | ||
}); |
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": { | ||
"nodeFlags": ["--lazy", "--trace-deprecation"] | ||
} | ||
} |
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,6 @@ | ||
'use strict'; | ||
|
||
exports.default = function(done) { | ||
console.log('Default'); | ||
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,7 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
flags: { | ||
nodeFlags: '--lazy', | ||
}, | ||
}; |
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,6 @@ | ||
'use strict'; | ||
|
||
exports.default = function(done) { | ||
console.log('Default'); | ||
done(); | ||
}; |