Skip to content

Commit

Permalink
Trigger AUCTION_DEBUG from utils.logWarn with type set to WARNING (#6645
Browse files Browse the repository at this point in the history
)

* added support for pubcommon, digitrust, id5id

* added support for IdentityLink

* changed the source for id5

* added unit test cases

* changed source param for identityLink

* emit AUCTION_DEBUG for logWarn with type WARNING

* fixed the unit test case
  • Loading branch information
pm-harshad-mane authored Apr 28, 2021
1 parent 09dcc38 commit 581a699
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ export function logWarn() {
if (debugTurnedOn() && consoleWarnExists) {
console.warn.apply(console, decorateLog(arguments, 'WARNING:'));
}
events.emit(CONSTANTS.EVENTS.AUCTION_DEBUG, {type: 'WARNING', arguments: arguments});
}

export function logError() {
Expand Down
6 changes: 4 additions & 2 deletions test/spec/AnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ FEATURE: Analytics Adapters API
events.emit(eventType, args);
adapter.enableAnalytics();

let result = JSON.parse(server.requests[0].requestBody);
expect(result).to.deep.equal({args: {wat: 'wot'}, eventType: 'bidResponse'});
// As now AUCTION_DEBUG is triggered for WARNINGS too, the BID_RESPONSE goes last in the array
const index = server.requests.length - 1;
let result = JSON.parse(server.requests[index].requestBody);
expect(result).to.deep.equal({eventType: 'bidResponse', args: {wat: 'wot'}});
});

describe(`WHEN an event occurs after enable analytics\n`, function () {
Expand Down

0 comments on commit 581a699

Please sign in to comment.