Upgrade to gulp4

`gulp.task` was replaced with `module.exports` but no other changes were
required.
This commit is contained in:
Matthew Amato 2018-11-06 12:15:18 -05:00
parent 0b30a11e3a
commit 94987d7343
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,9 +39,9 @@ gulp.task('test', function (done) {
jasmine.onComplete(function (passed) {
done(argv.failTaskOnError && !passed ? 1 : 0);
});
});
}
gulp.task('test-watch', function () {
function testWatch() {
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.
@ -46,9 +53,9 @@ gulp.task('test-watch', function () {
console.log('Tests failed to execute.');
}
});
});
}
gulp.task('coverage', function () {
function coverage() {
fsExtra.removeSync('coverage/server');
child_process.execSync('nyc' +
' --all' +
@ -59,10 +66,10 @@ gulp.task('coverage', function () {
' JASMINE_CONFIG_PATH=specs/jasmine.json', {
stdio: [process.stdin, process.stdout, process.stderr]
});
open('coverage/lcov-report/index.html');
});
return 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",