Skip to content

Commit

Permalink
removed some tasks and added notest flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnellbaker committed Aug 13, 2018
1 parent 73a1df1 commit 50aec49
Show file tree
Hide file tree
Showing 3 changed files with 176 additions and 143 deletions.
38 changes: 11 additions & 27 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ var argv = require('yargs').argv;
var gulp = require('gulp');
var gutil = require('gulp-util');
var connect = require('gulp-connect');
// var path = require('path');
var webpack = require('webpack');
var webpackStream = require('webpack-stream');
var uglify = require('gulp-uglify');
Expand All @@ -15,8 +14,6 @@ var karmaConfMaker = require('./karma.conf.maker');
var opens = require('open');
var webpackConfig = require('./webpack.conf');
var helpers = require('./gulpHelpers');
var del = require('del');
var gulpDocumentation = require('gulp-documentation');
var concat = require('gulp-concat');
var header = require('gulp-header');
var footer = require('gulp-footer');
Expand Down Expand Up @@ -55,11 +52,6 @@ function clean() {
.pipe(gulpClean());
}

function cleandocs() {
del(['docs']);
};
cleandocs.displayName = 'clean-docs';

function e2etestReport() {
var reportPort = 9010;
var targetDestinationDir = './e2etest-report';
Expand Down Expand Up @@ -250,20 +242,24 @@ function newKarmaCallback(done) {
// If --file "<path-to-test-file>" is given, the task will only run tests in the specified file.
// If --browserstack is given, it will run the full suite of currently supported browsers.
// If --browsers is given, browsers can be chosen explicitly. e.g. --browsers=chrome,firefox,ie9
// If --notest is given, it will immediately skip the test task (useful for developing changes with `gulp serve --notest`)

function test(done) {
var karmaConf = karmaConfMaker(false, argv.browserstack, argv.watch, argv.file);
if (argv.notest) {
done();
} else {
var karmaConf = karmaConfMaker(false, argv.browserstack, argv.watch, argv.file);

var browserOverride = helpers.parseBrowserArgs(argv).map(helpers.toCapitalCase);
if (browserOverride.length > 0) {
karmaConf.browsers = browserOverride;
}
var browserOverride = helpers.parseBrowserArgs(argv).map(helpers.toCapitalCase);
if (browserOverride.length > 0) {
karmaConf.browsers = browserOverride;
}

new KarmaServer(karmaConf, newKarmaCallback(done)).start();
new KarmaServer(karmaConf, newKarmaCallback(done)).start();
}
}

// If --file "<path-to-test-file>" is given, the task will only run tests in the specified file.

function testCoverage(done) {
new KarmaServer(karmaConfMaker(true, false, false, argv.file), newKarmaCallback(done)).start();
}
Expand All @@ -275,15 +271,6 @@ function coveralls() { // 2nd arg is a dependency: 'test' must be finished
.pipe(shell('cat build/coverage/lcov.info | node_modules/coveralls/bin/coveralls.js'));
}

function docs() {
return gulp.src('src/prebid.js')
.pipe(gulpDocumentation('md'))
.on('error', function (err) {
gutil.log('`gulp-documentation` failed:', err.message);
})
.pipe(gulp.dest('docs'));
}

function e2eTest() {
var cmdQueue = [];
if (argv.browserstack) {
Expand Down Expand Up @@ -329,7 +316,6 @@ gulp.task(lint);
gulp.task(watch);

gulp.task(clean);
gulp.task(cleandocs);

gulp.task(escapePostbidConfig);

Expand Down Expand Up @@ -357,7 +343,5 @@ gulp.task('e2etest', gulp.series(clean, gulp.parallel(makeDevpackPkg, makeWebpac
gulp.task(bundleToStdout);
gulp.task('bundle', gulpBundle.bind(null, false)); // used for just concatenating pre-built files with no build step
gulp.task('serve-nw', gulp.parallel(lint, watch, 'e2etest'));
gulp.task('docs', gulp.series(cleandocs, docs));
gulp.task('run-tests', gulp.series(lint, 'test-coverage'));

module.exports = nodeBundle;
Loading

0 comments on commit 50aec49

Please sign in to comment.