Merge pull request #167 from AnalyticalGraphicsInc/gulp4

Upgrade to gulp4
This commit is contained in:
Sean Lilley 2018-11-06 17:58:39 -05:00 committed by GitHub
commit 2fde781c99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 12 deletions

View File

@ -22,7 +22,14 @@ process.env.PATH += environmentSeparator + nodeBinaries;
var specFiles = ['**/*.js', '!node_modules/**', '!coverage/**', '!doc/**', '!bin/**'];
gulp.task('test', function (done) {
module.exports = {
test: test,
'test-watch': testWatch,
coverage: coverage,
cloc: cloc
};
function test(done) {
var jasmine = new Jasmine();
jasmine.loadConfigFile('specs/jasmine.json');
jasmine.addReporter(new JasmineSpecReporter({
@ -32,10 +39,10 @@ gulp.task('test', function (done) {
jasmine.onComplete(function (passed) {
done(argv.failTaskOnError && !passed ? 1 : 0);
});
});
}
gulp.task('test-watch', function () {
gulp.watch(specFiles).on('change', function () {
function testWatch() {
return gulp.watch(specFiles).on('change', function () {
// We can't simply depend on the test task because Jasmine
// does not like being run multiple times in the same process.
try {
@ -46,9 +53,9 @@ gulp.task('test-watch', function () {
console.log('Tests failed to execute.');
}
});
});
}
gulp.task('coverage', function () {
async function coverage() {
fsExtra.removeSync('coverage/server');
child_process.execSync('nyc' +
' --all' +
@ -57,12 +64,12 @@ gulp.task('coverage', function () {
' -x "specs/**" -x "coverage/**" -x "doc/**" -x "bin/**" -x "index.js" -x "gulpfile.js"' +
' node_modules/jasmine/bin/jasmine.js' +
' JASMINE_CONFIG_PATH=specs/jasmine.json', {
stdio: [process.stdin, process.stdout, process.stderr]
});
stdio: [process.stdin, process.stdout, process.stderr]
});
open('coverage/lcov-report/index.html');
});
}
gulp.task('cloc', function() {
function cloc() {
var cmdLine;
var clocPath = path.join('node_modules', 'cloc', 'lib', 'cloc');
@ -98,4 +105,4 @@ gulp.task('cloc', function() {
});
});
});
});
}

View File

@ -39,7 +39,7 @@
"coveralls": "^3.0.2",
"eslint": "^5.6.1",
"eslint-config-cesium": "^6.0.0",
"gulp": "^3.9.1",
"gulp": "^4.0.0",
"jasmine": "^3.2.0",
"jasmine-spec-reporter": "^4.2.1",
"jsdoc": "^3.5.5",