fix(assert): name the test when a JSON assertion skips for missing jq - #1224
Merged
Conversation
bashunit::skip resolves the label two frames up, which is the test when a test calls it directly. require_jq is reached through an assertion, so frame 2 was the helper itself: on a machine without jq every JSON test reported as "Bashunit::assert json::require jq", and several tests skipped for the same reason were indistinguishable in the run output and under --show-skipped. State the depth explicitly, the convention src/api/skip_todo.sh already documents for public helpers. All five JSON assertions call require_jq from the same distance, so one depth covers them. Closes #1223
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.
🤔 Background
Related #1223
When
jqis absent, JSON assertions skip the test — correct, and documented. The skip line named the internal helper instead of the test, so every JSON test in a suite rendered asBashunit::assert json::require jqand none of them could be told apart in the output or under--show-skipped.bashunit::skipreads the label two frames up, which is the test only when a test calls it directly;require_jqis reached through an assertion and sits two frames deeper.💡 Changes
require_jq, the conventionsrc/api/skip_todo.shalready documents for public helpers — all five JSON assertions call it from the same distancejqfromPATHand asserts the skipped tests carry their own names, including two tests skipped for the same reason staying distinguishablejqskips rather than fails