Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Price Floors #4931

Merged
merged 13 commits into from
Mar 31, 2020
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,13 @@ function test(done) {

execa(wdioCmd, wdioOpts, { stdio: 'inherit' })
.then(stdout => {
//kill mock server
// kill mock server
mockServer.kill('SIGINT');
done();
process.exit(0);
})
.catch(err => {
//kill mock server
// kill mock server
mockServer.kill('SIGINT');
done(new Error(`Tests failed with error: ${err}`));
process.exit(1);
Expand Down
4 changes: 4 additions & 0 deletions modules/currency.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getGlobal } from '../src/prebidGlobal.js';
import { createBid } from '../src/bidfactory.js';
import { STATUS } from '../src/constants.json';
import { ajax } from '../src/ajax.js';
Expand Down Expand Up @@ -122,6 +123,8 @@ function initCurrency(url) {

utils.logInfo('Installing addBidResponse decorator for currency module', arguments);

// Adding conversion function to prebid global for external module and on page use
getGlobal().convertCurrency = (cpm, fromCurrency, toCurrency) => parseFloat(cpm) * getCurrencyConversion(fromCurrency, toCurrency);
getHook('addBidResponse').before(addBidResponseHook, 100);

// call for the file if we haven't already
Expand Down Expand Up @@ -149,6 +152,7 @@ function resetCurrency() {
utils.logInfo('Uninstalling addBidResponse decorator for currency module', arguments);

getHook('addBidResponse').getHooks({hook: addBidResponseHook}).remove();
delete getGlobal().convertCurrency;

adServerCurrency = 'USD';
conversionCache = {};
Expand Down
Loading