Skip to content

fix(assert): name the test when a JSON assertion skips for missing jq - #1224

Merged
Chemaclass merged 1 commit into
mainfrom
fix/1223-json-skip-label
Aug 14, 2026
Merged

fix(assert): name the test when a JSON assertion skips for missing jq#1224
Chemaclass merged 1 commit into
mainfrom
fix/1223-json-skip-label

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

🤔 Background

Related #1223

When jq is 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 as Bashunit::assert json::require jq and none of them could be told apart in the output or under --show-skipped.

bashunit::skip reads the label two frames up, which is the test only when a test calls it directly; require_jq is reached through an assertion and sits two frames deeper.

💡 Changes

  • State the depth explicitly in require_jq, the convention src/api/skip_todo.sh already documents for public helpers — all five JSON assertions call it from the same distance
  • Add an acceptance test that hides jq from PATH and asserts the skipped tests carry their own names, including two tests skipped for the same reason staying distinguishable
  • Pin the documented contract alongside it: a missing jq skips rather than fails

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
@Chemaclass Chemaclass added the bug Something isn't working label Aug 14, 2026
@Chemaclass Chemaclass self-assigned this Aug 14, 2026
@Chemaclass
Chemaclass merged commit 8aed3dd into main Aug 14, 2026
37 checks passed
@Chemaclass
Chemaclass deleted the fix/1223-json-skip-label branch August 14, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant