Skip to content

Commit 3c9592f

Browse files
deekshithraopmkendall07
authored andcommitted
Upgrade packages (#3405)
* 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
1 parent 10a9111 commit 3c9592f

File tree

6 files changed

+702
-1678
lines changed

6 files changed

+702
-1678
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Working examples can be found in [the developer docs](http://prebid.org/dev-docs
2929
$ cd Prebid.js
3030
$ npm install
3131

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

3434
*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.
3535

gulpfile.js

+24-25
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ var _ = require('lodash');
44
var argv = require('yargs').argv;
55
var gulp = require('gulp');
66
var gutil = require('gulp-util');
7-
var webserver = require('gulp-webserver');
7+
var connect = require('gulp-connect');
88
var webpack = require('webpack');
99
var webpackStream = require('webpack-stream');
1010
var uglify = require('gulp-uglify');
1111
var gulpClean = require('gulp-clean');
1212
var KarmaServer = require('karma').Server;
1313
var karmaConfMaker = require('./karma.conf.maker');
14-
var opens = require('open');
14+
var opens = require('opn');
1515
var webpackConfig = require('./webpack.conf');
1616
var helpers = require('./gulpHelpers');
1717
var concat = require('gulp-concat');
@@ -56,12 +56,11 @@ function e2etestReport() {
5656
var reportPort = 9010;
5757
var targetDestinationDir = './e2etest-report';
5858
helpers.createEnd2EndTestReport(targetDestinationDir);
59-
gulp.src('./')
60-
.pipe(webserver({
61-
port: reportPort,
62-
directoryListing: true,
63-
livereload: true
64-
}));
59+
connect.server({
60+
port: reportPort,
61+
root: './',
62+
livereload: true
63+
});
6564

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

94-
var stream = gulp.src('./')
95-
.pipe(webserver({
96-
port: coveragePort,
97-
directoryListing: true,
98-
livereload: false,
99-
open: 'build/coverage/karma_html/index.html'
100-
}));
101-
stream.on('finish', done);
93+
connect.server({
94+
port: coveragePort,
95+
root: 'build/coverage/karma_html',
96+
livereload: false
97+
});
98+
opens('http://localhost:' + coveragePort);
99+
done();
102100
};
101+
103102
viewCoverage.displayName = 'view-coverage';
104103

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

118-
var stream = gulp.src('./')
119-
.pipe(webserver({
120-
https: argv.https,
121-
port: port,
122-
directoryListing: true,
123-
livereload: true
124-
}));
117+
connect.server({
118+
https: argv.https,
119+
port: port,
120+
root: './',
121+
livereload: true
122+
});
125123

126124
mainWatcher.on('all', gulp.series(clean, gulp.parallel(lint, 'build-bundle-dev', test)));
127125
loaderWatcher.on('all', gulp.series(lint));
128-
stream.on('finish', done);
126+
done();
129127
};
130128

131129
function makeDevpackPkg() {
@@ -140,7 +138,8 @@ function makeDevpackPkg() {
140138
.pipe(helpers.nameModules(externalModules))
141139
.pipe(webpackStream(cloned, webpack))
142140
.pipe(replace('$prebid.version$', prebid.version))
143-
.pipe(gulp.dest('build/dev'));
141+
.pipe(gulp.dest('build/dev'))
142+
.pipe(connect.reload());
144143
}
145144

146145
function makeWebpackPkg() {

karma.conf.maker.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ function newPluginsArray(browserstack) {
3434
'karma-es5-shim',
3535
'karma-mocha',
3636
'karma-chai',
37-
'karma-requirejs',
3837
'karma-sinon',
3938
'karma-sourcemap-loader',
4039
'karma-spec-reporter',
@@ -125,6 +124,7 @@ module.exports = function(codeCoverage, browserstack, watchMode, file) {
125124

126125
webpack: webpackConfig,
127126
webpackMiddleware: {
127+
stats: 'errors-only',
128128
noInfo: true
129129
},
130130
// frameworks to use

0 commit comments

Comments
 (0)