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
Better assertion failures for containJsonKeyValue #3949
Conversation
Now prints whether the key was missing, or if it had wrong value
shouldFail { | ||
json.shouldContainJsonKeyValue("$.bicycle.engine", "V2") | ||
}.message shouldBe """ | ||
Expected given to contain json key <'$.bicycle.engine'> but key was not found. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to print partial matches, such as:
Expected given to contain json key <'$.store.book.weight'> but key was not found.
Found the following sub-key: <'$.store.book'>.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose it would, but I don't believe we get that information out of the JsonPath library. How do you intend that we should calculate that subkey?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think perhaps we can merge this small improvement as-is, and we could make further improvements in a separate PR :) We can continue the discussion here even after PR is merged
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.kotest:kotest-runner-junit5](https://togithub.com/kotest/kotest) | `5.8.1` -> `5.9.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.kotest:kotest-runner-junit5/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.kotest:kotest-runner-junit5/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.kotest:kotest-runner-junit5/5.8.1/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.kotest:kotest-runner-junit5/5.8.1/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>kotest/kotest (io.kotest:kotest-runner-junit5)</summary> ### [`v5.9.0`](https://togithub.com/kotest/kotest/releases/tag/v5.9.0) #### Highlights Support for wasmJs has been added, curtesy of [@​OliverO2](https://togithub.com/OliverO2) #### What's Changed - Add wasmJs target by [@​OliverO2](https://togithub.com/OliverO2) in [kotest/kotest#3805 - fix(docs): indentation in System Extensions by [@​craigpastro](https://togithub.com/craigpastro) in [kotest/kotest#3940 - Change Arb.filterIsInstance() signature to use single type parameter by [@​kshired](https://togithub.com/kshired) in [kotest/kotest#3943 - Add missing functions to property-arbs docs by [@​snowe2010](https://togithub.com/snowe2010) in [kotest/kotest#3945 - Increasing JVM heap allowance on GitHub by [@​Kantis](https://togithub.com/Kantis) in [kotest/kotest#3948 - Fix JS and Wasm/JS test timeouts, bring back Node.js test output by [@​OliverO2](https://togithub.com/OliverO2) in [kotest/kotest#3953 - add-similarity-to-contains-draft ([#​42](https://togithub.com/kotest/kotest/issues/42)) by [@​AlexCue987](https://togithub.com/AlexCue987) in [kotest/kotest#3906 - Update Sonatype snapshot URL by [@​aSemy](https://togithub.com/aSemy) in [kotest/kotest#3956 - Fix json assertions artifact coordinate in docs by [@​TWiStErRob](https://togithub.com/TWiStErRob) in [kotest/kotest#3968 - Create CODE_OF_CONDUCT.md by [@​sschuberth](https://togithub.com/sschuberth) in [kotest/kotest#3987 - Restructure Kotlin/JS and Kotlin/JS/Wasm testing, fix [#​3329](https://togithub.com/kotest/kotest/issues/3329) by [@​OliverO2](https://togithub.com/OliverO2) in [kotest/kotest#3954 - Correct Collection Matchers Documentation For `collection.shouldContainAllInAnyOrder()` by [@​u-ways-e](https://togithub.com/u-ways-e) in [kotest/kotest#3995 - chore(deps): update plugin com.gradle.enterprise to v3.17.2 by [@​renovate](https://togithub.com/renovate) in [kotest/kotest#3990 - Add kotlin-faker to extensions list by [@​serpro69](https://togithub.com/serpro69) in [kotest/kotest#3971 - Better assertion failures for containJsonKeyValue by [@​Kantis](https://togithub.com/Kantis) in [kotest/kotest#3949 - fix(deps): update dependency io.github.classgraph:classgraph to v4.8.172 by [@​renovate](https://togithub.com/renovate) in [kotest/kotest#3957 - Add similarity to contain exactly in any order by [@​AlexCue987](https://togithub.com/AlexCue987) in [kotest/kotest#3938 - Fix Arb.list failing within edge cases in case of null values by [@​oliverblaha](https://togithub.com/oliverblaha) in [kotest/kotest#3982 - chore(deps): update plugin kotlinbinarycompatibilityvalidator to v0.14.0 by [@​renovate](https://togithub.com/renovate) in [kotest/kotest#3993 - chore(deps): update plugin io.kotest.multiplatform to v5.8.1 by [@​renovate](https://togithub.com/renovate) in [kotest/kotest#3992 - fixing the kotest autoscan warning message to reference the right property name by [@​stepanv](https://togithub.com/stepanv) in [kotest/kotest#4000 - fix(deps): update dependency io.projectreactor.tools:blockhound to v1.0.9.release by [@​renovate](https://togithub.com/renovate) in [kotest/kotest#3989 - Allow comparison between empty set and other iterables by [@​Kantis](https://togithub.com/Kantis) in [kotest/kotest#4005 - Moving similarity feature to kotest-assertions-core by [@​Kantis](https://togithub.com/Kantis) in [kotest/kotest#4006 #### New Contributors - [@​craigpastro](https://togithub.com/craigpastro) made their first contribution in [kotest/kotest#3940 - [@​snowe2010](https://togithub.com/snowe2010) made their first contribution in [kotest/kotest#3945 - [@​TWiStErRob](https://togithub.com/TWiStErRob) made their first contribution in [kotest/kotest#3968 - [@​u-ways-e](https://togithub.com/u-ways-e) made their first contribution in [kotest/kotest#3995 - [@​serpro69](https://togithub.com/serpro69) made their first contribution in [kotest/kotest#3971 - [@​stepanv](https://togithub.com/stepanv) made their first contribution in [kotest/kotest#4000 **Full Changelog**: kotest/kotest@v5.8.1...v5.9.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Never, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/StefanLobbenmeier/yt-dlp-compose). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNTEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjM1MS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.kotest:kotest-bom](https://togithub.com/kotest/kotest) | `5.8.1` -> `5.9.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.kotest:kotest-bom/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.kotest:kotest-bom/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.kotest:kotest-bom/5.8.1/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.kotest:kotest-bom/5.8.1/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>kotest/kotest (io.kotest:kotest-bom)</summary> ### [`v5.9.0`](https://togithub.com/kotest/kotest/releases/tag/v5.9.0) #### Highlights Support for wasmJs has been added, curtesy of [@​OliverO2](https://togithub.com/OliverO2) #### What's Changed - Add wasmJs target by [@​OliverO2](https://togithub.com/OliverO2) in [kotest/kotest#3805 - fix(docs): indentation in System Extensions by [@​craigpastro](https://togithub.com/craigpastro) in [kotest/kotest#3940 - Change Arb.filterIsInstance() signature to use single type parameter by [@​kshired](https://togithub.com/kshired) in [kotest/kotest#3943 - Add missing functions to property-arbs docs by [@​snowe2010](https://togithub.com/snowe2010) in [kotest/kotest#3945 - Increasing JVM heap allowance on GitHub by [@​Kantis](https://togithub.com/Kantis) in [kotest/kotest#3948 - Fix JS and Wasm/JS test timeouts, bring back Node.js test output by [@​OliverO2](https://togithub.com/OliverO2) in [kotest/kotest#3953 - add-similarity-to-contains-draft ([#​42](https://togithub.com/kotest/kotest/issues/42)) by [@​AlexCue987](https://togithub.com/AlexCue987) in [kotest/kotest#3906 - Update Sonatype snapshot URL by [@​aSemy](https://togithub.com/aSemy) in [kotest/kotest#3956 - Fix json assertions artifact coordinate in docs by [@​TWiStErRob](https://togithub.com/TWiStErRob) in [kotest/kotest#3968 - Create CODE_OF_CONDUCT.md by [@​sschuberth](https://togithub.com/sschuberth) in [kotest/kotest#3987 - Restructure Kotlin/JS and Kotlin/JS/Wasm testing, fix [#​3329](https://togithub.com/kotest/kotest/issues/3329) by [@​OliverO2](https://togithub.com/OliverO2) in [kotest/kotest#3954 - Correct Collection Matchers Documentation For `collection.shouldContainAllInAnyOrder()` by [@​u-ways-e](https://togithub.com/u-ways-e) in [kotest/kotest#3995 - chore(deps): update plugin com.gradle.enterprise to v3.17.2 by [@​renovate](https://togithub.com/renovate) in [kotest/kotest#3990 - Add kotlin-faker to extensions list by [@​serpro69](https://togithub.com/serpro69) in [kotest/kotest#3971 - Better assertion failures for containJsonKeyValue by [@​Kantis](https://togithub.com/Kantis) in [kotest/kotest#3949 - fix(deps): update dependency io.github.classgraph:classgraph to v4.8.172 by [@​renovate](https://togithub.com/renovate) in [kotest/kotest#3957 - Add similarity to contain exactly in any order by [@​AlexCue987](https://togithub.com/AlexCue987) in [kotest/kotest#3938 - Fix Arb.list failing within edge cases in case of null values by [@​oliverblaha](https://togithub.com/oliverblaha) in [kotest/kotest#3982 - chore(deps): update plugin kotlinbinarycompatibilityvalidator to v0.14.0 by [@​renovate](https://togithub.com/renovate) in [kotest/kotest#3993 - chore(deps): update plugin io.kotest.multiplatform to v5.8.1 by [@​renovate](https://togithub.com/renovate) in [kotest/kotest#3992 - fixing the kotest autoscan warning message to reference the right property name by [@​stepanv](https://togithub.com/stepanv) in [kotest/kotest#4000 - fix(deps): update dependency io.projectreactor.tools:blockhound to v1.0.9.release by [@​renovate](https://togithub.com/renovate) in [kotest/kotest#3989 - Allow comparison between empty set and other iterables by [@​Kantis](https://togithub.com/Kantis) in [kotest/kotest#4005 - Moving similarity feature to kotest-assertions-core by [@​Kantis](https://togithub.com/Kantis) in [kotest/kotest#4006 #### New Contributors - [@​craigpastro](https://togithub.com/craigpastro) made their first contribution in [kotest/kotest#3940 - [@​snowe2010](https://togithub.com/snowe2010) made their first contribution in [kotest/kotest#3945 - [@​TWiStErRob](https://togithub.com/TWiStErRob) made their first contribution in [kotest/kotest#3968 - [@​u-ways-e](https://togithub.com/u-ways-e) made their first contribution in [kotest/kotest#3995 - [@​serpro69](https://togithub.com/serpro69) made their first contribution in [kotest/kotest#3971 - [@​stepanv](https://togithub.com/stepanv) made their first contribution in [kotest/kotest#4000 **Full Changelog**: kotest/kotest@v5.8.1...v5.9.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/typesafegithub/github-actions-typing). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNTEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjM1MS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.kotest:kotest-assertions-core](https://togithub.com/kotest/kotest) | `5.8.1` -> `5.9.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.kotest:kotest-assertions-core/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.kotest:kotest-assertions-core/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.kotest:kotest-assertions-core/5.8.1/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.kotest:kotest-assertions-core/5.8.1/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>kotest/kotest (io.kotest:kotest-assertions-core)</summary> ### [`v5.9.0`](https://togithub.com/kotest/kotest/releases/tag/v5.9.0) #### Highlights Support for wasmJs has been added, curtesy of [@​OliverO2](https://togithub.com/OliverO2) #### What's Changed - Add wasmJs target by [@​OliverO2](https://togithub.com/OliverO2) in [kotest/kotest#3805 - fix(docs): indentation in System Extensions by [@​craigpastro](https://togithub.com/craigpastro) in [kotest/kotest#3940 - Change Arb.filterIsInstance() signature to use single type parameter by [@​kshired](https://togithub.com/kshired) in [kotest/kotest#3943 - Add missing functions to property-arbs docs by [@​snowe2010](https://togithub.com/snowe2010) in [kotest/kotest#3945 - Increasing JVM heap allowance on GitHub by [@​Kantis](https://togithub.com/Kantis) in [kotest/kotest#3948 - Fix JS and Wasm/JS test timeouts, bring back Node.js test output by [@​OliverO2](https://togithub.com/OliverO2) in [kotest/kotest#3953 - add-similarity-to-contains-draft ([#​42](https://togithub.com/kotest/kotest/issues/42)) by [@​AlexCue987](https://togithub.com/AlexCue987) in [kotest/kotest#3906 - Update Sonatype snapshot URL by [@​aSemy](https://togithub.com/aSemy) in [kotest/kotest#3956 - Fix json assertions artifact coordinate in docs by [@​TWiStErRob](https://togithub.com/TWiStErRob) in [kotest/kotest#3968 - Create CODE_OF_CONDUCT.md by [@​sschuberth](https://togithub.com/sschuberth) in [kotest/kotest#3987 - Restructure Kotlin/JS and Kotlin/JS/Wasm testing, fix [#​3329](https://togithub.com/kotest/kotest/issues/3329) by [@​OliverO2](https://togithub.com/OliverO2) in [kotest/kotest#3954 - Correct Collection Matchers Documentation For `collection.shouldContainAllInAnyOrder()` by [@​u-ways-e](https://togithub.com/u-ways-e) in [kotest/kotest#3995 - chore(deps): update plugin com.gradle.enterprise to v3.17.2 by [@​renovate](https://togithub.com/renovate) in [kotest/kotest#3990 - Add kotlin-faker to extensions list by [@​serpro69](https://togithub.com/serpro69) in [kotest/kotest#3971 - Better assertion failures for containJsonKeyValue by [@​Kantis](https://togithub.com/Kantis) in [kotest/kotest#3949 - fix(deps): update dependency io.github.classgraph:classgraph to v4.8.172 by [@​renovate](https://togithub.com/renovate) in [kotest/kotest#3957 - Add similarity to contain exactly in any order by [@​AlexCue987](https://togithub.com/AlexCue987) in [kotest/kotest#3938 - Fix Arb.list failing within edge cases in case of null values by [@​oliverblaha](https://togithub.com/oliverblaha) in [kotest/kotest#3982 - chore(deps): update plugin kotlinbinarycompatibilityvalidator to v0.14.0 by [@​renovate](https://togithub.com/renovate) in [kotest/kotest#3993 - chore(deps): update plugin io.kotest.multiplatform to v5.8.1 by [@​renovate](https://togithub.com/renovate) in [kotest/kotest#3992 - fixing the kotest autoscan warning message to reference the right property name by [@​stepanv](https://togithub.com/stepanv) in [kotest/kotest#4000 - fix(deps): update dependency io.projectreactor.tools:blockhound to v1.0.9.release by [@​renovate](https://togithub.com/renovate) in [kotest/kotest#3989 - Allow comparison between empty set and other iterables by [@​Kantis](https://togithub.com/Kantis) in [kotest/kotest#4005 - Moving similarity feature to kotest-assertions-core by [@​Kantis](https://togithub.com/Kantis) in [kotest/kotest#4006 #### New Contributors - [@​craigpastro](https://togithub.com/craigpastro) made their first contribution in [kotest/kotest#3940 - [@​snowe2010](https://togithub.com/snowe2010) made their first contribution in [kotest/kotest#3945 - [@​TWiStErRob](https://togithub.com/TWiStErRob) made their first contribution in [kotest/kotest#3968 - [@​u-ways-e](https://togithub.com/u-ways-e) made their first contribution in [kotest/kotest#3995 - [@​serpro69](https://togithub.com/serpro69) made their first contribution in [kotest/kotest#3971 - [@​stepanv](https://togithub.com/stepanv) made their first contribution in [kotest/kotest#4000 **Full Changelog**: kotest/kotest@v5.8.1...v5.9.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/TeamDev-IP/JxBrowser-Gradle-Plugin). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNTEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjM1MS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Now prints whether the key was missing, or if it had wrong value