prebid.js 7.48.0 → 7.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/admixerBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/aidemBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/beopBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/confiantRtdProvider.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantAnalyticsAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/dependencies.json +3 -0
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/greenbidsAnalyticsAdapter.js +1 -1
- package/dist/greenbidsRtdProvider.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -1
- package/dist/kulturemediaBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveIntentIdSystem.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/minutemediaplusBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +136 -134
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/permutiveRtdProvider.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +1 -1
- package/dist/prebidServerBidAdapter.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticAnalyticsAdapter.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/retailspotBidAdapter.js +1 -0
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rubiconAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/silverpushBidAdapter.js +1 -0
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/uid2IdSystem.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/video.js +1 -1
- package/dist/videoModule.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yieldlabBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/integrationExamples/videoModule/eventsUI/eventsUI.css +205 -0
- package/integrationExamples/videoModule/eventsUI/eventsUI.js +181 -0
- package/integrationExamples/videoModule/jwplayer/eventsUI.html +295 -0
- package/integrationExamples/videoModule/videojs/eventsUI.html +319 -0
- package/libraries/video/shared/helpers.js +14 -0
- package/modules/33acrossBidAdapter.js +1 -1
- package/modules/adgenerationBidAdapter.js +24 -15
- package/modules/admixerBidAdapter.js +15 -9
- package/modules/aidemBidAdapter.js +3 -1
- package/modules/appnexusBidAdapter.js +1 -0
- package/modules/beopBidAdapter.js +1 -0
- package/modules/confiantRtdProvider.js +15 -12
- package/modules/conversantAnalyticsAdapter.js +7 -5
- package/modules/conversantBidAdapter.js +1 -1
- package/modules/criteoBidAdapter.js +17 -1
- package/modules/gridBidAdapter.js +3 -0
- package/modules/ixBidAdapter.js +65 -47
- package/modules/kueezRtbBidAdapter.js +30 -33
- package/modules/liveIntentIdSystem.js +8 -4
- package/modules/magniteAnalyticsAdapter.js +26 -3
- package/modules/mgidBidAdapter.js +9 -8
- package/modules/minutemediaBidAdapter.js +6 -0
- package/modules/minutemediaplusBidAdapter.js +30 -32
- package/modules/nexx360BidAdapter.js +2 -1
- package/modules/permutiveRtdProvider.js +9 -38
- package/modules/prebidServerBidAdapter/index.js +1 -3
- package/modules/prebidServerBidAdapter/ortbConverter.js +5 -1
- package/modules/pubmaticAnalyticsAdapter.js +3 -2
- package/modules/retailspotBidAdapter .md +32 -0
- package/modules/retailspotBidAdapter.js +186 -0
- package/modules/riseBidAdapter.js +6 -0
- package/modules/rubiconBidAdapter.js +6 -2
- package/modules/silverpushBidAdapter.js +326 -0
- package/modules/silverpushBidAdapter.md +107 -0
- package/modules/ttdBidAdapter.js +23 -22
- package/modules/underdogmediaBidAdapter.js +2 -2
- package/modules/vidazooBidAdapter.js +28 -32
- package/modules/videoModule/adQueue.js +2 -2
- package/modules/videoModule/index.js +9 -5
- package/modules/yahoosspBidAdapter.js +6 -0
- package/modules/yahoosspBidAdapter.md +37 -0
- package/modules/yieldlabBidAdapter.js +27 -5
- package/package.json +1 -1
- package/src/adapterManager.js +4 -0
- package/src/adapters/bidderFactory.js +1 -0
- package/src/auction.js +2 -0
- package/src/prebid.js +36 -12
- package/src/utils/cpm.js +4 -1
- package/test/spec/modules/33acrossBidAdapter_spec.js +4 -3
- package/test/spec/modules/adgenerationBidAdapter_spec.js +6 -6
- package/test/spec/modules/admixerBidAdapter_spec.js +64 -25
- package/test/spec/modules/aidemBidAdapter_spec.js +3 -0
- package/test/spec/modules/beopBidAdapter_spec.js +4 -0
- package/test/spec/modules/confiantRtdProvider_spec.js +4 -1
- package/test/spec/modules/conversantBidAdapter_spec.js +2 -1
- package/test/spec/modules/criteoBidAdapter_spec.js +109 -0
- package/test/spec/modules/gridBidAdapter_spec.js +3 -0
- package/test/spec/modules/ixBidAdapter_spec.js +66 -1
- package/test/spec/modules/kueezRtbBidAdapter_spec.js +3 -2
- package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +28 -0
- package/test/spec/modules/liveIntentIdSystem_spec.js +45 -0
- package/test/spec/modules/magniteAnalyticsAdapter_spec.js +16 -36
- package/test/spec/modules/mass_spec.js +2 -0
- package/test/spec/modules/mgidBidAdapter_spec.js +9 -9
- package/test/spec/modules/minutemediaBidAdapter_spec.js +18 -0
- package/test/spec/modules/minutemediaplusBidAdapter_spec.js +3 -2
- package/test/spec/modules/permutiveRtdProvider_spec.js +0 -20
- package/test/spec/modules/prebidServerBidAdapter_spec.js +96 -1
- package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +6 -1
- package/test/spec/modules/retailspotBidAdapter_spec.js +426 -0
- package/test/spec/modules/riseBidAdapter_spec.js +18 -0
- package/test/spec/modules/rubiconBidAdapter_spec.js +143 -67
- package/test/spec/modules/silverpushBidAdapter_spec.js +394 -0
- package/test/spec/modules/ttdBidAdapter_spec.js +129 -2
- package/test/spec/modules/underdogmediaBidAdapter_spec.js +1 -1
- package/test/spec/modules/vidazooBidAdapter_spec.js +3 -2
- package/test/spec/modules/videoModule/shared/helpers_spec.js +22 -0
- package/test/spec/modules/yahoosspBidAdapter_spec.js +60 -1
- package/test/spec/modules/yieldlabBidAdapter_spec.js +8 -1
- package/test/spec/unit/core/bidderFactory_spec.js +9 -9
- package/test/spec/unit/pbjs_api_spec.js +59 -1
- package/test/spec/unit/utils/cpm_spec.js +56 -1
|
@@ -191,6 +191,7 @@ const NATIVE_RESPONSE = Object.assign({}, RESPONSE, {
|
|
|
191
191
|
url: 'https://localhost:8080/yl-logo100x100.jpg',
|
|
192
192
|
w: 100,
|
|
193
193
|
h: 100,
|
|
194
|
+
type: 3,
|
|
194
195
|
},
|
|
195
196
|
},
|
|
196
197
|
{
|
|
@@ -557,7 +558,6 @@ describe('yieldlabBidAdapter', () => {
|
|
|
557
558
|
|
|
558
559
|
it('should add adUrl and native assets when type is Native', () => {
|
|
559
560
|
const result = spec.interpretResponse({body: [NATIVE_RESPONSE]}, {validBidRequests: [NATIVE_REQUEST()], queryParams: REQPARAMS});
|
|
560
|
-
|
|
561
561
|
expect(result[0].requestId).to.equal('2d925f27f5079f');
|
|
562
562
|
expect(result[0].cpm).to.equal(0.01);
|
|
563
563
|
expect(result[0].mediaType).to.equal('native');
|
|
@@ -569,6 +569,13 @@ describe('yieldlabBidAdapter', () => {
|
|
|
569
569
|
expect(result[0].native.image.height).to.equal(100);
|
|
570
570
|
expect(result[0].native.clickUrl).to.equal('https://www.yieldlab.de');
|
|
571
571
|
expect(result[0].native.impressionTrackers.length).to.equal(3);
|
|
572
|
+
expect(result[0].native.assets.length).to.equal(3);
|
|
573
|
+
const titleAsset = result[0].native.assets.find(asset => 'title' in asset);
|
|
574
|
+
const imageAsset = result[0].native.assets.find(asset => 'img' in asset);
|
|
575
|
+
const bodyAsset = result[0].native.assets.find(asset => 'data' in asset);
|
|
576
|
+
expect(titleAsset).to.exist.and.to.have.nested.property('id', 1)
|
|
577
|
+
expect(imageAsset).to.exist.and.to.have.nested.property('id', 2)
|
|
578
|
+
expect(bodyAsset).to.exist.and.to.have.nested.property('id', 3)
|
|
572
579
|
});
|
|
573
580
|
|
|
574
581
|
it('should add adUrl and default native assets when type is Native', () => {
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
|
+
addComponentAuction,
|
|
3
|
+
isValid,
|
|
2
4
|
newBidder,
|
|
3
|
-
registerBidder,
|
|
4
5
|
preloadBidderMappingFile,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
addComponentAuction
|
|
6
|
+
registerBidder,
|
|
7
|
+
storage
|
|
8
8
|
} from 'src/adapters/bidderFactory.js';
|
|
9
9
|
import adapterManager from 'src/adapterManager.js';
|
|
10
10
|
import * as ajax from 'src/ajax.js';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import {expect} from 'chai';
|
|
12
|
+
import {userSync} from 'src/userSync.js';
|
|
13
13
|
import * as utils from 'src/utils.js';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import {config} from 'src/config.js';
|
|
15
|
+
import {server} from 'test/mocks/xhr.js';
|
|
16
16
|
import CONSTANTS from 'src/constants.json';
|
|
17
17
|
import * as events from 'src/events.js';
|
|
18
18
|
import {hook} from '../../../../src/hook.js';
|
|
19
19
|
import {auctionManager} from '../../../../src/auctionManager.js';
|
|
20
20
|
import {stubAuctionIndex} from '../../../helpers/indexStub.js';
|
|
21
|
-
import {
|
|
21
|
+
import {bidderSettings} from '../../../../src/bidderSettings.js';
|
|
22
22
|
import {decorateAdUnitsWithNativeParams} from '../../../../src/native.js';
|
|
23
23
|
|
|
24
24
|
const CODE = 'sampleBidder';
|
|
@@ -2501,7 +2501,6 @@ describe('Unit: Prebid Module', function () {
|
|
|
2501
2501
|
}];
|
|
2502
2502
|
let adUnitCodes = ['adUnit-code'];
|
|
2503
2503
|
let auction = auctionModule.newAuction({adUnits, adUnitCodes, callback: function() {}, cbTimeout: timeout});
|
|
2504
|
-
|
|
2505
2504
|
adUnits[0]['mediaTypes'] = { native: {} };
|
|
2506
2505
|
adUnitCodes = ['adUnit-code'];
|
|
2507
2506
|
let auction1 = auctionModule.newAuction({adUnits, adUnitCodes, callback: function() {}, cbTimeout: timeout});
|
|
@@ -3546,4 +3545,63 @@ describe('Unit: Prebid Module', function () {
|
|
|
3546
3545
|
expect(bids[0].adId).to.equal('adid-1');
|
|
3547
3546
|
});
|
|
3548
3547
|
});
|
|
3548
|
+
|
|
3549
|
+
describe('deferred billing', function () {
|
|
3550
|
+
const sandbox = sinon.createSandbox();
|
|
3551
|
+
|
|
3552
|
+
let adUnits = [
|
|
3553
|
+
{
|
|
3554
|
+
code: 'adUnit-code-1',
|
|
3555
|
+
mediaTypes: { banner: { sizes: [[300, 250], [300, 600]] } },
|
|
3556
|
+
transactionId: '1234567890',
|
|
3557
|
+
bids: [
|
|
3558
|
+
{ bidder: 'pubmatic', params: {placementId: '10433394'}, adUnitCode: 'adUnit-code-1' }
|
|
3559
|
+
]
|
|
3560
|
+
},
|
|
3561
|
+
{
|
|
3562
|
+
code: 'adUnit-code-2',
|
|
3563
|
+
deferBilling: true,
|
|
3564
|
+
mediaTypes: { banner: { sizes: [[300, 250], [300, 600]] } },
|
|
3565
|
+
transactionId: '0987654321',
|
|
3566
|
+
bids: [
|
|
3567
|
+
{ bidder: 'pubmatic', params: {placementId: '10433394'}, adUnitCode: 'adUnit-code-2' }
|
|
3568
|
+
]
|
|
3569
|
+
}
|
|
3570
|
+
];
|
|
3571
|
+
|
|
3572
|
+
let winningBid1 = { adapterCode: 'pubmatic', bidder: 'pubmatic', params: {placementId: '10433394'}, adUnitCode: 'adUnit-code-1', transactionId: '1234567890', adId: 'abcdefg' }
|
|
3573
|
+
let winningBid2 = { adapterCode: 'pubmatic', bidder: 'pubmatic', params: {placementId: '10433394'}, adUnitCode: 'adUnit-code-2', transactionId: '0987654321' }
|
|
3574
|
+
let adUnitCodes = ['adUnit-code-1', 'adUnit-code-2'];
|
|
3575
|
+
let auction = auctionModule.newAuction({adUnits, adUnitCodes, callback: function() {}, cbTimeout: 2000});
|
|
3576
|
+
|
|
3577
|
+
beforeEach(function () {
|
|
3578
|
+
sandbox.spy(adapterManager, 'callBidWonBidder');
|
|
3579
|
+
sandbox.spy(adapterManager, 'callBidBillableBidder');
|
|
3580
|
+
sandbox.stub(auctionManager, 'getBidsReceived').returns([winningBid1]);
|
|
3581
|
+
});
|
|
3582
|
+
|
|
3583
|
+
afterEach(function () {
|
|
3584
|
+
sandbox.resetHistory();
|
|
3585
|
+
sandbox.restore();
|
|
3586
|
+
});
|
|
3587
|
+
|
|
3588
|
+
it('should by default invoke callBidWonBidder and callBidBillableBidder', function () {
|
|
3589
|
+
auction.addWinningBid(winningBid1);
|
|
3590
|
+
sinon.assert.calledOnce(adapterManager.callBidWonBidder);
|
|
3591
|
+
sinon.assert.calledOnce(adapterManager.callBidBillableBidder);
|
|
3592
|
+
});
|
|
3593
|
+
|
|
3594
|
+
it('should only invoke callBidWonBidder and NOT callBidBillableBidder if deferBilling is present and true within the winning adUnit object', function () {
|
|
3595
|
+
auction.addWinningBid(winningBid2);
|
|
3596
|
+
sinon.assert.calledOnce(adapterManager.callBidWonBidder);
|
|
3597
|
+
sinon.assert.notCalled(adapterManager.callBidBillableBidder);
|
|
3598
|
+
});
|
|
3599
|
+
|
|
3600
|
+
it('should invoke callBidBillableBidder when pbjs.triggerBilling is invoked', function () {
|
|
3601
|
+
$$PREBID_GLOBAL$$.triggerBilling(winningBid1);
|
|
3602
|
+
sinon.assert.calledOnce(auctionManager.getBidsReceived);
|
|
3603
|
+
sinon.assert.notCalled(adapterManager.callBidWonBidder);
|
|
3604
|
+
sinon.assert.calledOnce(adapterManager.callBidBillableBidder);
|
|
3605
|
+
});
|
|
3606
|
+
});
|
|
3549
3607
|
});
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import {adjustCpm} from '../../../../src/utils/cpm.js';
|
|
2
|
+
import {ScopedSettings} from '../../../../src/bidderSettings.js';
|
|
3
|
+
import {expect} from 'chai/index.js';
|
|
2
4
|
|
|
3
5
|
describe('adjustCpm', () => {
|
|
4
6
|
const bidderCode = 'mockBidder';
|
|
5
7
|
let adjustmentFn, bs, index;
|
|
6
8
|
beforeEach(() => {
|
|
7
9
|
bs = {
|
|
8
|
-
get: sinon.stub()
|
|
10
|
+
get: sinon.stub(),
|
|
11
|
+
getOwn: sinon.stub()
|
|
9
12
|
}
|
|
10
13
|
index = {
|
|
11
14
|
getBidRequest: sinon.stub()
|
|
@@ -62,3 +65,55 @@ describe('adjustCpm', () => {
|
|
|
62
65
|
});
|
|
63
66
|
})
|
|
64
67
|
});
|
|
68
|
+
|
|
69
|
+
describe('adjustAlternateBids', () => {
|
|
70
|
+
let bs;
|
|
71
|
+
afterEach(() => {
|
|
72
|
+
bs = null;
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
function runAdjustment(cpm, bidderCode, adapterCode) {
|
|
76
|
+
return adjustCpm(cpm, {bidderCode, adapterCode}, null, {bs: new ScopedSettings(() => bs)});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
it('should fall back to the adapter adjustment fn when adjustAlternateBids is true', () => {
|
|
80
|
+
bs = {
|
|
81
|
+
adapter: {
|
|
82
|
+
adjustAlternateBids: true,
|
|
83
|
+
bidCpmAdjustment: function (cpm) {
|
|
84
|
+
return cpm * 2;
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
bidder: {}
|
|
88
|
+
};
|
|
89
|
+
expect(runAdjustment(1, 'bidder', 'adapter')).to.eql(2);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('should NOT fall back to the adapter adjustment fn when adjustAlternateBids is not true', () => {
|
|
93
|
+
bs = {
|
|
94
|
+
adapter: {
|
|
95
|
+
bidCpmAdjustment(cpm) {
|
|
96
|
+
return cpm * 2
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
expect(runAdjustment(1, 'bidder', 'adapter')).to.eql(1);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('should prioritize bidder adjustment fn', () => {
|
|
104
|
+
bs = {
|
|
105
|
+
adapter: {
|
|
106
|
+
adjustAlternateBids: true,
|
|
107
|
+
bidCpmAdjustment(cpm) {
|
|
108
|
+
return cpm * 2
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
bidder: {
|
|
112
|
+
bidCpmAdjustment(cpm) {
|
|
113
|
+
return cpm * 3
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
expect(runAdjustment(1, 'bidder', 'adapter')).to.eql(3);
|
|
118
|
+
});
|
|
119
|
+
});
|