diff --git a/.babelrc b/.babelrc index 8726a848e2e..b366d78478e 100644 --- a/.babelrc +++ b/.babelrc @@ -1,4 +1,8 @@ { "presets": ["es2015"], - "plugins": ["transform-object-assign", "transform-es3-property-literals", "transform-es3-member-expression-literals"] + "plugins": [ + "transform-object-assign", + "transform-es3-property-literals", + "transform-es3-member-expression-literals" + ] } diff --git a/README.md b/README.md index ac15a991f0c..4bcf2213f8e 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,11 @@ To run the unit tests: ```bash gulp test ``` +To run tests for a single file: + +```bash +gulp test --file "path/to/spec/file.js" +``` To generate and view the code coverage reports: diff --git a/gulpfile.js b/gulpfile.js index 7b05b22ad06..92851bbc192 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -28,6 +28,7 @@ var gulpif = require('gulp-if'); var sourcemaps = require('gulp-sourcemaps'); var through = require('through2'); var fs = require('fs'); +var jsEscape = require('gulp-js-escape'); var prebid = require('./package.json'); var dateString = 'Updated : ' + (new Date()).toISOString().substring(0, 10); @@ -296,10 +297,21 @@ gulp.task('e2etest-report', function() { }, 5000); }); -gulp.task('build-postbid', function() { +// This task creates postbid.js. Postbid setup is different from prebid.js +// More info can be found here http://prebid.org/overview/what-is-post-bid.html +gulp.task('build-postbid', ['escape-postbid-config'], function() { + var fileContent = fs.readFileSync('./build/postbid/postbid-config.js', 'utf8'); + return gulp.src('./integrationExamples/postbid/oas/postbid.js') - .pipe(uglify()) - .pipe(gulp.dest('build/dist')); + .pipe(replace('\[%%postbid%%\]', fileContent)) + .pipe(gulp.dest('build/postbid/')); +}); + +// Dependant task for building postbid. It escapes postbid-config file. +gulp.task('escape-postbid-config', function() { + gulp.src('./integrationExamples/postbid/oas/postbid-config.js') + .pipe(jsEscape()) + .pipe(gulp.dest('build/postbid/')); }); module.exports = nodeBundle; diff --git a/integrationExamples/gpt/hello_world.html b/integrationExamples/gpt/hello_world.html index 0f5e24a301a..aa4bf5ea782 100644 --- a/integrationExamples/gpt/hello_world.html +++ b/integrationExamples/gpt/hello_world.html @@ -12,91 +12,91 @@ --> -
- - - - + + + - - - - - - - -