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

Fix alwaysUseBid bid setting #392

Closed
wants to merge 15 commits into from

Conversation

kmjennison
Copy link
Contributor

Fix for #389.

@@ -171,6 +171,36 @@ function getWinningBidTargeting() {
return winners;
}

exports.getWinningBidTargeting = function() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems you are exporting functions for the sole purpose of making them available to test. We've been following the general principle that we should test the public API of a module, that is the exports and ES2015 style named exports, but not the internal implementation of a module. Test coverage should show that comprehensive testing of the public API also covers internal implementation, or where it does not it indicates insufficient tests or cruft in the code. In any event, the export of functions in order to test should be avoided as it can be misleading as to the intent of the module.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a helpful description of the test philosophy, thank you.

@protonate
Copy link
Collaborator

Thanks for contributing this fix, looks good, please see the comments about test strategy and remove unneeded exports, move tests to public API.

@protonate protonate self-assigned this Jun 7, 2016
@protonate
Copy link
Collaborator

We would like to include this in our pending release. We'll go ahead and merge as-is unless you have an update in the works.

@kmjennison
Copy link
Contributor Author

Thanks for the comments. I'll have a PR addressing them within the next few hours.

@kmjennison
Copy link
Contributor Author

@protonate These latest commits address your comments:

  • moved testing to the public setTargetingForGPTAsync rather than testing the internal implementation
  • removed unneeded exports from prebid.js

I also improved a few existing tests for setTargetingForGPTAsync to verify the targeting key/values are correct.

@mkendall07
Copy link
Member

@kmjennison
Can you resolve conflicts? Thanks

@protonate
Copy link
Collaborator

@mkendall07 @kmjennison The conflict is due to Deal ID PR (merged) and this PR touching the same code so I've resolved conflicts, I'm going to get a review from @matthewlane to confirm Deal ID functionality, test and then merge this PR.

@protonate
Copy link
Collaborator

This has been merged manually, closing, thanks for the fix @kmjennison.

@protonate protonate closed this Jun 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants