Guides on choosing assertion libraries and writing test failures that show actual vs expected values, structured diffs, and precise error messages.
An assertion is where a test states what it expects, and its output is the
first thing you read when it fails. A bare assert result prints "false" and
tells you nothing; a good assertion prints the expected value, the actual
value, and enough of the surrounding structure to locate the divergence. The
library and style you choose largely decide which of those two failures you get.
assertThat(actual).isEqualTo(expected),
expect(x).toEqual(y), result.should.equal(...). On failure these print a
structured diff; a hand-rolled assert a == b prints only the line, not the
values.expect(list)
.toContain(x) and assertThat(user.name).isEqualTo("Ada") fail with a
precise message. assert x in list reduced to a boolean throws away the
values, so wrap the value, not the comparison result.toEqual or isEqualTo deep equality and pick out
fields with matchers (objectContaining, hasItem, AssertJ extracting) so
the failure shows which field of which element differs, not just "objects
not equal".SoftAssertions, expect.soft) that
reports every failure in one run when the checks genuinely belong together.toBeValidOrder, a Hamcrest
TypeSafeMatcher) so the test reads in domain terms and the failure message
speaks that language instead of dumping raw fields every time.assertRaises(ValueError, match="negative amount") or
expect(fn).toThrow(/negative/) so a test cannot pass on the wrong
exception. Catching bare Exception hides the case where the code failed for
an unrelated reason.This is about assertion style and readable failures, not what to assert, which is a design question the test's purpose answers. Snapshot assertions are a distinct trade-off with their own failure mode. Stay with the assertion library a project has adopted rather than mixing three dialects in one suite.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Not loaded · from ai-skills-commands
Claude Code won't load this skill
It ships in ai-skills-commands at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
npx claudepluginhub amey-thakur/ai-skills --plugin ai-skills-commands1,000 skills in this plugin
/ab-test-designDesign product experiments with real hypotheses, honest sample-size math, guardrails, and peeking discipline. Use when validating a change by experiment or reviewing a test before believing its result./accessibility-reviewAudit a UI for real accessibility, keyboard-first, with concrete failures and fixes rather than checkbox compliance. Use when reviewing or building any user interface./accessibility-specialist-roleOperate as an accessibility specialist who audits against WCAG, trains teams to stop shipping the same defects, and owns the compliance sign-off. Use when a product needs to be usable with a keyboard, a screen reader, or magnification and someone must certify it before launch./accessible-formsBuild forms with associated labels, identified errors, clear instructions, and autocomplete attributes. Use when creating or auditing forms for accessibility./actions-securityPrevent workflow automation from becoming an attack path, through pinned actions, scoped tokens, and careful handling of untrusted input. Use when workflows handle secrets or run on pull requests from forks./agent-accountability-loopTrack every commitment from assignment to completion, chasing what is late and escalating what is stuck, so work finishes rather than fading. Use when things are agreed in meetings and quietly never happen.Other plugins' skills for the same job