Skip to content

Commit

Permalink
Build Process: Disallow it.skip (#9799)
Browse files Browse the repository at this point in the history
* Update realvuAnalyticsAdapter_spec.js

* Update axonixBidAdapter_spec.js

* Update pubCommonId_spec.js

* Update test_index.js

* Update test_index.js

* Update adagioBidAdapter_spec.js

* Update test_index.js

* Update test_index.js

* Update test_index.js

* Update test_index.js

* Update openxOrtbBidAdapter_spec.js

* Update 1plusXRtdProvider_spec.js

* Update pubmaticBidAdapter_spec.js
  • Loading branch information
patmmccann authored Apr 19, 2023
1 parent a539646 commit ad7d898
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 96 deletions.
15 changes: 8 additions & 7 deletions test/spec/modules/1plusXRtdProvider_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,16 @@ describe('1plusXRtdProvider', () => {
}

it('correctly builds URLs if gdpr parameters are present', () => {
const url1 = getPapiUrl(customer)
const url2 = getPapiUrl(customer, extractConsent(consent))
expect(['&consent_string=myConsent&gdpr_applies=1', '&gdpr_applies=1&consent_string=myConsent']).to.contain(url2.replace(url1, ''))
const url1 = getPapiUrl(customer);
const url2 = getPapiUrl(customer, extractConsent(consent));
expect(['&consent_string=myConsent&gdpr_applies=1', '&gdpr_applies=1&consent_string=myConsent']).to.contain(url2.replace(url1, ''));
})

it('correctly builds URLs if fpid parameters are present')
const url1 = getPapiUrl(customer)
const url2 = getPapiUrl(customer, {}, 'my_first_party_id')
expect(url2.replace(url1, '')).to.equal('&fpid=my_first_party_id')
it('correctly builds URLs if fpid parameters are present', () => {
const url1 = getPapiUrl(customer);
const url2 = getPapiUrl(customer, {}, 'my_first_party_id');
expect(url2.replace(url1, '')).to.equal('&fpid=my_first_party_id');
})
})

describe('updateBidderConfig', () => {
Expand Down
25 changes: 0 additions & 25 deletions test/spec/modules/adagioBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1481,31 +1481,6 @@ describe('Adagio bid adapter', () => {
});
});

describe.skip('optional params auto detection', function() {
it('should auto detect adUnitElementId when GPT is used', function() {
sandbox.stub(utils, 'getGptSlotInfoForAdUnitCode').withArgs('banner').returns({divId: 'gpt-banner'});
expect(adagio.autoDetectAdUnitElementId('banner')).to.eq('gpt-banner');
});
});

describe.skip('print number handling', function() {
it('should return 1 if no adunit-code found. This means it is the first auction', function() {
sandbox.stub(adagio, 'getPageviewId').returns('abc-def');
expect(adagio.computePrintNumber('adunit-code')).to.eql(1);
});

it('should increment the adunit print number when the adunit-code has already been used for an other auction', function() {
sandbox.stub(adagio, 'getPageviewId').returns('abc-def');

window.top.ADAGIO.adUnits['adunit-code'] = {
pageviewId: 'abc-def',
printNumber: 1,
};

expect(adagio.computePrintNumber('adunit-code')).to.eql(2);
});
});

describe('site information using refererDetection or window.top', function() {
it('should returns domain, page and window.referrer in a window.top context', function() {
const bidderRequest = new BidderRequestBuilder({
Expand Down
27 changes: 0 additions & 27 deletions test/spec/modules/axonixBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,26 +286,6 @@ describe('AxonixBidAdapter', function () {
});
});

describe.skip('buildRequests: can handle native ad requests', function () {
it('creates ServerRequests pointing to the correct region and endpoint if it changes', function () {
// loop:
// set supply id
// set region/endpoint in ssp config
// call buildRequests, validate request (url, method, supply id)
expect.fail('Not implemented');
});

it('creates ServerRequests pointing to default endpoint if missing', function () {
// no endpoint in config means default value openrtb.axonix.com
expect.fail('Not implemented');
});

it('creates ServerRequests pointing to default region if missing', function () {
// no region in config means default value us-east-1
expect.fail('Not implemented');
});
});

describe('interpretResponse', function () {
it('considers corner cases', function() {
expect(spec.interpretResponse(null)).to.be.an('array').that.is.empty;
Expand All @@ -331,13 +311,6 @@ describe('AxonixBidAdapter', function () {
expect(response).to.be.an('array').that.is.not.empty;
expect(response[0]).to.equal(VIDEO_RESPONSE.body[0]);
});

it.skip('parses 1 native responses', function () {
// passing 1 valid native in a response generates an array with 1 correct prebid response
// examine mediaType:native, native element
// check nativeBidIsValid from {@link file://./../../../src/native.js}
expect.fail('Not implemented');
});
});

describe('onBidWon', function () {
Expand Down
17 changes: 0 additions & 17 deletions test/spec/modules/pubCommonId_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,23 +233,6 @@ describe('Publisher Common ID', function () {
});
});
});

it.skip('disable auto create', function() {
setConfig({
create: false
});

const config = getPubcidConfig();
expect(config.create).to.be.false;
expect(config.typeEnabled).to.equal('html5');

let adUnits = getAdUnits();
let innerAdUnits;
requestBidHook((config) => { innerAdUnits = config.adUnits }, {adUnits});

const pubcid = localStorage.getItem(ID_NAME);
expect(pubcid).to.be.null;
});
});

describe('Invoking requestBid', function () {
Expand Down
12 changes: 0 additions & 12 deletions test/spec/modules/pubmaticBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1118,18 +1118,6 @@ describe('PubMatic adapter', function () {
expect(data.test).to.equal(undefined);
});

// disabled this test case as it refreshes the whole suite when in karma watch mode
// todo: needs a fix
xit('test flag set to 1 when pubmaticTest=true is present in page url', function() {
window.location.href += '#pubmaticTest=true';
// now all the test cases below will have window.location.href with #pubmaticTest=true
let request = spec.buildRequests(bidRequests, {
auctionId: 'new-auction-id'
});
let data = JSON.parse(request.data);
expect(data.test).to.equal(1);
});

it('Request params check', function () {
let request = spec.buildRequests(bidRequests, {
auctionId: 'new-auction-id'
Expand Down
5 changes: 0 additions & 5 deletions test/spec/modules/realvuAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ describe('RealVu', function() {
result = realvuAnalyticsAdapter.checkIn(bid, ''); // test invalid partnerId ''
});

it.skip('isInView returns "yes"', () => {
let inview = realvuAnalyticsAdapter.isInView('ad1');
expect(inview).to.equal('yes');
});

it('isInView return "NA"', function () {
const adUnitCode = '1234';
let result = realvuAnalyticsAdapter.isInView(adUnitCode);
Expand Down
16 changes: 13 additions & 3 deletions test/test_index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

[it, describe].forEach((ob) => {
ob.only = function () {
[
Expand All @@ -7,8 +6,19 @@
// eslint-disable-next-line no-console
].forEach(l => console.error(l))
throw new Error('do not use .only()')
}
})
};
});

[it, describe].forEach((ob) => {
ob.skip = function () {
[
'describe.skip and it.skip are disabled,',
'because they pollute the pipeline test output',
// eslint-disable-next-line no-console
].forEach(l => console.error(l))
throw new Error('do not use .skip()')
};
});

require('./test_deps.js');

Expand Down

0 comments on commit ad7d898

Please sign in to comment.