Skip to content

Commit

Permalink
Upgrade packages (prebid#3405)
Browse files Browse the repository at this point in the history
* RAD-2356 Upgrade Mocha karma-webpack karma

* RAD-2356 update readme to support node v6 or more

* Remove webpack output logs while testing

* move from gulp-webserver to gulp-connect

* remove karma-require and redundant watch task
  • Loading branch information
deekshithraop authored and mkendall07 committed Jan 3, 2019
1 parent 10a9111 commit 3c9592f
Show file tree
Hide file tree
Showing 6 changed files with 702 additions and 1,678 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Working examples can be found in [the developer docs](http://prebid.org/dev-docs
$ cd Prebid.js
$ npm install

*Note:* You need to have `NodeJS` 4.x or greater installed.
*Note:* You need to have `NodeJS` 6.x or greater installed.

*Note:* In the 1.24.0 release of Prebid.js we have transitioned to using gulp 4.0 from using gulp 3.9.1. To compily with gulp's recommended setup for 4.0, you'll need to have `gulp-cli` installed globally prior to running the general `npm install`. This shouldn't impact any other projects you may work on that use an earlier version of gulp in it's setup.

Expand Down
49 changes: 24 additions & 25 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ var _ = require('lodash');
var argv = require('yargs').argv;
var gulp = require('gulp');
var gutil = require('gulp-util');
var webserver = require('gulp-webserver');
var connect = require('gulp-connect');
var webpack = require('webpack');
var webpackStream = require('webpack-stream');
var uglify = require('gulp-uglify');
var gulpClean = require('gulp-clean');
var KarmaServer = require('karma').Server;
var karmaConfMaker = require('./karma.conf.maker');
var opens = require('open');
var opens = require('opn');
var webpackConfig = require('./webpack.conf');
var helpers = require('./gulpHelpers');
var concat = require('gulp-concat');
Expand Down Expand Up @@ -56,12 +56,11 @@ function e2etestReport() {
var reportPort = 9010;
var targetDestinationDir = './e2etest-report';
helpers.createEnd2EndTestReport(targetDestinationDir);
gulp.src('./')
.pipe(webserver({
port: reportPort,
directoryListing: true,
livereload: true
}));
connect.server({
port: reportPort,
root: './',
livereload: true
});

setTimeout(function() {
opens('http://localhost:' + reportPort + '/' + targetDestinationDir.slice(2) + '/results.html');
Expand Down Expand Up @@ -91,15 +90,15 @@ function lint(done) {
function viewCoverage(done) {
var coveragePort = 1999;

var stream = gulp.src('./')
.pipe(webserver({
port: coveragePort,
directoryListing: true,
livereload: false,
open: 'build/coverage/karma_html/index.html'
}));
stream.on('finish', done);
connect.server({
port: coveragePort,
root: 'build/coverage/karma_html',
livereload: false
});
opens('http://localhost:' + coveragePort);
done();
};

viewCoverage.displayName = 'view-coverage';

// Watch Task with Live Reload
Expand All @@ -115,17 +114,16 @@ function watch(done) {
'test/spec/loaders/**/*.js'
]);

var stream = gulp.src('./')
.pipe(webserver({
https: argv.https,
port: port,
directoryListing: true,
livereload: true
}));
connect.server({
https: argv.https,
port: port,
root: './',
livereload: true
});

mainWatcher.on('all', gulp.series(clean, gulp.parallel(lint, 'build-bundle-dev', test)));
loaderWatcher.on('all', gulp.series(lint));
stream.on('finish', done);
done();
};

function makeDevpackPkg() {
Expand All @@ -140,7 +138,8 @@ function makeDevpackPkg() {
.pipe(helpers.nameModules(externalModules))
.pipe(webpackStream(cloned, webpack))
.pipe(replace('$prebid.version$', prebid.version))
.pipe(gulp.dest('build/dev'));
.pipe(gulp.dest('build/dev'))
.pipe(connect.reload());
}

function makeWebpackPkg() {
Expand Down
2 changes: 1 addition & 1 deletion karma.conf.maker.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ function newPluginsArray(browserstack) {
'karma-es5-shim',
'karma-mocha',
'karma-chai',
'karma-requirejs',
'karma-sinon',
'karma-sourcemap-loader',
'karma-spec-reporter',
Expand Down Expand Up @@ -125,6 +124,7 @@ module.exports = function(codeCoverage, browserstack, watchMode, file) {

webpack: webpackConfig,
webpackMiddleware: {
stats: 'errors-only',
noInfo: true
},
// frameworks to use
Expand Down
Loading

0 comments on commit 3c9592f

Please sign in to comment.