From 2ec74becc81b2edd21c3046905ca9347bce9c2ef Mon Sep 17 00:00:00 2001 From: Jason Snellbaker Date: Tue, 15 May 2018 14:05:35 -0400 Subject: [PATCH] replace find reference with imported version --- src/auction.js | 2 +- test/spec/auctionmanager_spec.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/auction.js b/src/auction.js index df87641b5fc..654b6dbb189 100644 --- a/src/auction.js +++ b/src/auction.js @@ -298,7 +298,7 @@ function getPreparedBidForAuction({adUnitCode, bid, bidRequest, auctionId}) { events.emit(CONSTANTS.EVENTS.BID_ADJUSTMENT, bidObject); // a publisher-defined renderer can be used to render bids - const bidReq = bidRequest.bids && bidRequest.bids.find(bid => bid.adUnitCode == adUnitCode); + const bidReq = bidRequest.bids && find(bidRequest.bids, bid => bid.adUnitCode == adUnitCode); const adUnitRenderer = bidReq && bidReq.renderer; if (adUnitRenderer && adUnitRenderer.url) { diff --git a/test/spec/auctionmanager_spec.js b/test/spec/auctionmanager_spec.js index fff0150adb0..6fbc48b3cdc 100644 --- a/test/spec/auctionmanager_spec.js +++ b/test/spec/auctionmanager_spec.js @@ -7,6 +7,7 @@ import { newBidder, registerBidder } from 'src/adapters/bidderFactory'; import { config } from 'src/config'; import * as store from 'src/videoCache'; import * as ajaxLib from 'src/ajax'; +import find from 'core-js/library/fn/array/find'; const adloader = require('../../src/adloader'); var assert = require('assert'); @@ -669,7 +670,7 @@ describe('auctionmanager.js', function () { auction.callBids(); - const addedBid = auction.getBidsReceived().find(bid => bid.adUnitCode == ADUNIT_CODE); + const addedBid = find(auction.getBidsReceived(), bid => bid.adUnitCode == ADUNIT_CODE); assert.equal(addedBid.renderer.url, 'renderer.js'); }); });