@@ -3,6 +3,7 @@ import {config} from 'src/config.js';
3
3
import * as sinon from 'sinon' ;
4
4
import { default as CONSTANTS } from '../../../src/constants.json' ;
5
5
import { default as events } from '../../../src/events.js' ;
6
+ import 'src/prebid.js' ;
6
7
7
8
const getBidRequestDataSpy = sinon . spy ( ) ;
8
9
@@ -195,7 +196,7 @@ describe('Real time module', function () {
195
196
'name' : 'tp1' ,
196
197
} ,
197
198
{
198
- 'name' : 'tp2'
199
+ 'name' : 'tp2' ,
199
200
}
200
201
]
201
202
}
@@ -206,7 +207,7 @@ describe('Real time module', function () {
206
207
function eventHandlingProvider ( name ) {
207
208
const provider = {
208
209
name : name ,
209
- init : ( ) => true
210
+ init : ( ) => true ,
210
211
}
211
212
Object . values ( EVENTS ) . forEach ( ( ev ) => provider [ ev ] = sinon . spy ( ) ) ;
212
213
return provider ;
@@ -222,7 +223,19 @@ describe('Real time module', function () {
222
223
afterEach ( ( ) => {
223
224
_detachers . forEach ( ( d ) => d ( ) )
224
225
config . resetConfig ( ) ;
225
- } )
226
+ } ) ;
227
+
228
+ it ( 'should set targeting for auctionEnd' , ( ) => {
229
+ providers . forEach ( p => p . getTargetingData = sinon . spy ( ) ) ;
230
+ const auction = {
231
+ adUnitCodes : [ 'a1' ] ,
232
+ adUnits : [ { code : 'a1' } ]
233
+ } ;
234
+ mockEmitEvent ( CONSTANTS . EVENTS . AUCTION_END , auction ) ;
235
+ providers . forEach ( p => {
236
+ expect ( p . getTargetingData . calledWith ( auction . adUnitCodes ) ) . to . be . true ;
237
+ } ) ;
238
+ } ) ;
226
239
227
240
Object . entries ( EVENTS ) . forEach ( ( [ event , hook ] ) => {
228
241
it ( `'${ event } ' should be propagated to providers through '${ hook } '` , ( ) => {
0 commit comments