diff --git a/karma.conf.maker.js b/karma.conf.maker.js index d2b1d49e081..98148e565d3 100644 --- a/karma.conf.maker.js +++ b/karma.conf.maker.js @@ -1,7 +1,7 @@ // This configures Karma, describing how to run the tests and where to output code coverage reports. // // For more information, see http://karma-runner.github.io/1.0/config/configuration-file.html - +process.env.test = true; var _ = require('lodash'); var webpackConf = require('./webpack.conf'); var path = require('path') diff --git a/webpack.conf.js b/webpack.conf.js index 38f4e5dadd7..9f42fe46701 100644 --- a/webpack.conf.js +++ b/webpack.conf.js @@ -10,6 +10,8 @@ var neverBundle = [ 'AnalyticsAdapter.js' ]; +var prebidGlobalName = process.env.test ? 'pbjs_' + Math.floor(Math.random() * 10000) : prebid.globalVarName; + module.exports = { devtool: 'source-map', resolve: { @@ -77,7 +79,7 @@ module.exports = { { pattern: /\$\$PREBID_GLOBAL\$\$/g, replacement: function (match, p1, offset, string) { - return prebid.globalVarName; + return prebidGlobalName; } } ]