mirror of
https://github.com/CesiumGS/obj2gltf.git
synced 2024-11-23 08:34:14 -05:00
Merge pull request #167 from AnalyticalGraphicsInc/gulp4
Upgrade to gulp4
This commit is contained in:
commit
2fde781c99
29
gulpfile.js
29
gulpfile.js
@ -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() {
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user