-
-
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
11 changed files
with
185 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
Usage: gulp [options] tasks | ||
|
||
Options: | ||
--help, -h Show this help. [boolean] | ||
--version, -v Print the global and local gulp versions. [boolean] | ||
--require Will require a module before running the gulpfile. This is useful for transpilers but also has other applications. [string] | ||
--gulpfile Manually set path of gulpfile. Useful if you have multiple gulpfiles. This will set the CWD to the gulpfile directory as well. [string] | ||
--cwd Manually set the CWD. The search for the gulpfile, as well as the relativity of all requires will be from here. [string] | ||
--verify Will verify plugins referenced in project's package.json against the plugins blacklist. | ||
--tasks, -T Print the task dependency tree for the loaded gulpfile. [boolean] | ||
--tasks-simple Print a plaintext list of tasks for the loaded gulpfile. [boolean] | ||
--tasks-json Print the task dependency tree, in JSON format, for the loaded gulpfile. | ||
--color Will force gulp and gulp plugins to display colors, even when no color support is detected. [boolean] | ||
--no-color Will force gulp and gulp plugins to not display colors, even when color support is detected. [boolean] | ||
--silent, -S Suppress all gulp logging. [boolean] | ||
--continue Continue execution of tasks upon failure. [boolean] | ||
--log-level, -L Set the loglevel. -L for least verbose and -LLLL for most verbose. -LLL is default. [count] | ||
|
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'; | ||
var gulp = require('gulp'); | ||
|
||
function noop() {} | ||
|
||
gulp.task('default', noop); |
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
'use strict'; | ||
|
||
var gulp = require('gulp'); | ||
|
||
function noop() {} | ||
|
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,21 @@ | ||
{ | ||
"name": "test-package", | ||
"description": "Test Package for Testing!", | ||
"version": "0.0.1", | ||
"tags": [ | ||
], | ||
"files": [ | ||
], | ||
"dependencies": { | ||
"gulp-blink": "^0.1.4" | ||
}, | ||
"engines": { | ||
"node": ">= 0.9" | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "https://raw.githubusercontent.com/gulpjs/gulp/master/LICENSE" | ||
} | ||
] | ||
} |
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,21 @@ | ||
{ | ||
"name": "default-package", | ||
"description": "Test Package for Testing!", | ||
"version": "0.0.1", | ||
"tags": [ | ||
], | ||
"files": [ | ||
], | ||
"dependencies": { | ||
"gulp-blink": "^0.1.4" | ||
}, | ||
"engines": { | ||
"node": ">= 0.9" | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "https://raw.githubusercontent.com/gulpjs/gulp/master/LICENSE" | ||
} | ||
] | ||
} |
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,21 @@ | ||
{ | ||
"name": "test-package-2", | ||
"description": "Test Package for Testing!", | ||
"version": "0.0.1", | ||
"tags": [ | ||
], | ||
"files": [ | ||
], | ||
"dependencies": { | ||
"yargs": "^3.27.0" | ||
}, | ||
"engines": { | ||
"node": ">= 0.9" | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "https://raw.githubusercontent.com/gulpjs/gulp/master/LICENSE" | ||
} | ||
] | ||
} |
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,20 @@ | ||
'use strict'; | ||
|
||
var lab = exports.lab = require('lab').script(); | ||
var code = require('code'); | ||
|
||
var fs = require('fs'); | ||
var child = require('child_process'); | ||
|
||
lab.experiment('flag: --gulpfile', function() { | ||
|
||
lab.test('Manually set path of gulpfile', function(done) { | ||
child.exec('node ' + __dirname + '/../bin/gulp.js --gulpfile "./test/fixtures/gulpfile-2.js"', function(err, stdout) { | ||
stdout = stdout.replace(/\\/g, '/').split('\n'); | ||
code.expect(stdout[1]).to.contain('test/fixtures/gulpfile-2.js'); | ||
code.expect(stdout[3]).to.contain('Finished \'default\''); | ||
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,27 @@ | ||
'use strict'; | ||
|
||
var lab = exports.lab = require('lab').script(); | ||
var code = require('code'); | ||
|
||
var fs = require('fs'); | ||
var child = require('child_process'); | ||
|
||
var output = fs.readFileSync(__dirname + '/expected/flags-help.txt', 'utf8').replace(/\r\n/g, '\n'); | ||
|
||
lab.experiment('flag: help', function() { | ||
|
||
lab.test('shows help using --help', function(done) { | ||
child.exec('node ' + __dirname + '/../bin/gulp.js --help', function(err, stdout) { | ||
code.expect(stdout).to.equals(output); | ||
done(); | ||
}); | ||
}); | ||
|
||
lab.test('shows help using short --h', function(done) { | ||
child.exec('node ' + __dirname + '/../bin/gulp.js --h', function(err, stdout) { | ||
code.expect(stdout).to.equals(output); | ||
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,11 @@ | ||
'use strict'; | ||
|
||
var lab = exports.lab = require('lab').script(); | ||
var code = require('code'); | ||
|
||
var fs = require('fs'); | ||
var child = require('child_process'); | ||
|
||
lab.experiment('flag: --require', function() { | ||
lab.test('requires module before running gulpfile'); | ||
}); |
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,38 @@ | ||
'use strict'; | ||
var lab = exports.lab = require('lab').script(); | ||
var code = require('code'); | ||
|
||
var child = require('child_process'); | ||
|
||
lab.experiment('flag: --verify', function() { | ||
|
||
lab.test('dependencies with invalid dependency', function(done) { | ||
child.exec('node ' + __dirname + '/../bin/gulp.js --verify "packages/invalid-package.json" --cwd "./test/fixtures/packages/"', function(err, stdout) { | ||
// Ignore err as the verify failure is considered a error state. | ||
stdout = stdout.replace(/\\/g, '/').split('\n'); | ||
code.expect(stdout[1]).to.contain('Blacklisted plugins found in this project:'); | ||
code.expect(stdout[2]).to.contain('gulp-blink: deprecated. use `blink` instead.'); | ||
done(); | ||
}); | ||
}); | ||
|
||
lab.test('dependencies with valid dependency', function(done) { | ||
child.exec('node ' + __dirname + '/../bin/gulp.js --verify "packages/valid-package.json" --cwd "./test/fixtures/packages/"', function(err, stdout) { | ||
stdout = stdout.replace(/\\/g, '/').split('\n'); | ||
code.expect(stdout[1]).to.contain(' There are no blacklisted plugins in this project'); | ||
done(err); | ||
}); | ||
}); | ||
|
||
lab.test('default args with invalid dependency', function(done) { | ||
child.exec('node ' + __dirname + '/../bin/gulp.js --verify "packages/package.json" --cwd ./test/fixtures/packages/', function(err, stdout) { | ||
console.log(stdout); | ||
// Ignore err as the verify failure is considered a error state. | ||
stdout = stdout.replace(/\\/g, '/').split('\n'); | ||
code.expect(stdout[1]).to.contain('Blacklisted plugins found in this project:'); | ||
code.expect(stdout[2]).to.contain('gulp-blink: deprecated. use `blink` instead.'); | ||
done(); | ||
}); | ||
}); | ||
|
||
}); |