Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenX Adapter: Support out of order bids. #2452

Merged
merged 2 commits into from
May 1, 2018

Conversation

jimee02
Copy link
Contributor

@jimee02 jimee02 commented Apr 25, 2018

Type of change

  • Feature
  • Refactoring (no functional changes, no api changes)

Description of change

Feature

Added "idx" (index) so that we can return out of order bids will properly map back to request objects.
https://github.com/prebid/Prebid.js/pull/2452/files#diff-2051ef6e55abda4fed56905b5982884aR76

Refactor

Broke down unit tests and re-ordered them such that test suites will be more readable.
Added helper functions to generate cleaner bid response objects.

.find(key => !(key in contract));

if (invalidKey) {
throw new Error(`Mock Error: INVALID_KEY. Key:${invalidKey} does not exist in type: ${typeName}`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will stop execution of further unit tests. Wrap all calls to overrideKeyCheck in try..catch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaiminpanchal27, I've switched to using an assertion instead, which throws an AssertionError. I tested it when the keys are invalid and the beforeEach block catches the exception properly and continues on the other tests.

Jimmy Tu added 2 commits April 27, 2018 10:22
…hich throws an AssertionError, so that it will be caught properly by test suite when an invalid override is provided.
@jaiminpanchal27 jaiminpanchal27 merged commit 4a149cf into prebid:master May 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants