test: increase test coverage#8
Merged
andreafassina merged 1 commit intoSep 10, 2025
Merged
Conversation
andreafassina
approved these changes
Sep 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
About this pull request
We’ve added supplemental JSON tests for the error in getNativeryExt (e.g. widgetId of the wrong type) and also extended coverage with additional cases in MakeBids (204 with/without X-Nativery-Error, malformed bid.ext, bad response JSON, etc.).
For the other two error branches (getRequestExt and the first unmarshal in buildNativeryExt), these are not reachable with the supplemental JSON harness: the loader rejects any request.ext or imp.ext that is not a JSON object before it even reaches the adapter, so the errors cannot be triggered that way. Those paths are only hit if Prebid-server were fed invalidly shaped JSON at runtime, which the framework prevents.
So coverage is now above 90%, and all error paths that can be reached via the supplemental tests are exercised. The remaining uncovered lines are structurally unreachable via the harness, not due to missing tests.