From c224d395ebc725b154f9e8b93ac2f412b0d2f040 Mon Sep 17 00:00:00 2001 From: Jason Snellbaker Date: Mon, 23 Jul 2018 09:41:44 -0400 Subject: [PATCH 1/3] fix failing unit test for quantcastBidAdapter --- test/spec/modules/quantcastBidAdapter_spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/spec/modules/quantcastBidAdapter_spec.js b/test/spec/modules/quantcastBidAdapter_spec.js index 0b3a66efdfb..0f76c22ea8e 100644 --- a/test/spec/modules/quantcastBidAdapter_spec.js +++ b/test/spec/modules/quantcastBidAdapter_spec.js @@ -71,8 +71,8 @@ describe('Quantcast adapter', () => { it('sends bid requests to Quantcast Canary Endpoint if `publisherId` is `test-publisher`', () => { const requests = qcSpec.buildRequests([bidRequest]); - const url = new URL(requests[0]['url']); - expect(url.hostname).to.equal(QUANTCAST_TEST_DOMAIN); + const url = requests[0]['url'].split(/[:/]/)[3]; + expect(url).to.equal(QUANTCAST_TEST_DOMAIN); }); it('sends bid requests to default endpoint for non standard publisher IDs', () => { From 37d01eb61343d1d5f261163b1b3ae9c6b51685e8 Mon Sep 17 00:00:00 2001 From: Jason Snellbaker Date: Mon, 23 Jul 2018 09:51:24 -0400 Subject: [PATCH 2/3] rename variable to be clearer --- test/spec/modules/quantcastBidAdapter_spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/spec/modules/quantcastBidAdapter_spec.js b/test/spec/modules/quantcastBidAdapter_spec.js index 0f76c22ea8e..9d4e70f55cc 100644 --- a/test/spec/modules/quantcastBidAdapter_spec.js +++ b/test/spec/modules/quantcastBidAdapter_spec.js @@ -71,8 +71,8 @@ describe('Quantcast adapter', () => { it('sends bid requests to Quantcast Canary Endpoint if `publisherId` is `test-publisher`', () => { const requests = qcSpec.buildRequests([bidRequest]); - const url = requests[0]['url'].split(/[:/]/)[3]; - expect(url).to.equal(QUANTCAST_TEST_DOMAIN); + const hostname = requests[0]['url'].split(/[:/]/)[3]; + expect(hostname).to.equal(QUANTCAST_TEST_DOMAIN); }); it('sends bid requests to default endpoint for non standard publisher IDs', () => { From 3f43c20ac0aa9521e8853fdba6e9f003b0169c0d Mon Sep 17 00:00:00 2001 From: Jason Snellbaker Date: Mon, 23 Jul 2018 10:16:56 -0400 Subject: [PATCH 3/3] using alternate approach --- test/spec/modules/quantcastBidAdapter_spec.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/spec/modules/quantcastBidAdapter_spec.js b/test/spec/modules/quantcastBidAdapter_spec.js index 9d4e70f55cc..b6fc3f27f94 100644 --- a/test/spec/modules/quantcastBidAdapter_spec.js +++ b/test/spec/modules/quantcastBidAdapter_spec.js @@ -11,6 +11,7 @@ import { spec as qcSpec } from '../../../modules/quantcastBidAdapter'; import { newBidder } from '../../../src/adapters/bidderFactory'; +import { parse } from 'src/url'; describe('Quantcast adapter', () => { const quantcastAdapter = newBidder(qcSpec); @@ -71,8 +72,8 @@ describe('Quantcast adapter', () => { it('sends bid requests to Quantcast Canary Endpoint if `publisherId` is `test-publisher`', () => { const requests = qcSpec.buildRequests([bidRequest]); - const hostname = requests[0]['url'].split(/[:/]/)[3]; - expect(hostname).to.equal(QUANTCAST_TEST_DOMAIN); + const url = parse(requests[0]['url']); + expect(url.hostname).to.equal(QUANTCAST_TEST_DOMAIN); }); it('sends bid requests to default endpoint for non standard publisher IDs', () => {