Use this skill when selecting or running Biome test fixtures, quick tests, `insta` snapshot workflows, expectation comments, orphan checks, or required code generators. Do not use for subsystem implementation design.
76
94%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Choose the narrowest test that exercises the changed behavior, then broaden only when shared infrastructure or integration risk justifies it.
| Change | Start with |
|---|---|
| Lint rule | just test-lintrule <ruleName> |
| One crate | cargo test -p <crate> or the crate's focused test target |
| Parser or formatter investigation | just qt <package> |
| CLI migration | focused biome_cli migration tests |
| Documentation code | just test-doc |
Use -- --show-output or --nocapture only when the test's diagnostic output is needed.
Quick tests are scratch space for inspecting CST, formatter IR, or one analyzer query. Persistent behavior belongs in the subsystem's normal fixture directory before finishing.
Run the focused test to create pending snapshots. Treat unrelated test failures separately. Never update, add or delete snapshots manually. Let insta do that.
Agents must not run unfiltered cargo insta review; it needs a TTY. In a non-TTY agent shell, cargo-insta 1.44+ prints a filtered --snapshot diff without prompting:
cargo insta pending-snapshots --workspace
cargo insta review --workspace --snapshot '<path-from-list>'After inspecting the full diff, accept or reject only that snapshot:
cargo insta accept --workspace --snapshot '<same-path>'
cargo insta reject --workspace --snapshot '<same-path>'Repeat for each change, list pending snapshots again, then rerun the test. Review means checking behavior in the diff. A passing test proves only that output matches the snapshot.
Never use unfiltered cargo insta accept or cargo insta reject, cargo insta test --accept, cargo insta test --force-update-snapshots, or INSTA_UPDATE=always/force. They skip individual review and can modify unrelated work.
Do not delete suspected orphan snapshots manually. Deletion is safe only after running the complete workspace snapshot suite without package, target, or test filters:
cargo insta test --workspace --unreferenced deleteFor a scoped run, use --unreferenced warn or --unreferenced reject; incomplete test selection cannot prove that a snapshot is orphaned. Inspect every deletion from a complete run.
Every new or changed test that calls run_cli or a variant must snapshot the full session. Use assert_cli_snapshot, assert_cli_snapshot_with_redactor, or an insta-based wrapper. Scalar assertions do not replace the snapshot. Unit and helper tests that do not execute the CLI are exempt.
Snapshot after other assertions to capture the final filesystem, configuration, output, and result. Stabilize ordering or redact unstable values; do not omit the snapshot.
Keep related cases with the same arguments, configuration, source kind, and filesystem state in one fixture and usually one snapshot. Include valid, invalid, and boundary cases together. Keep related multi-file cases in one test. Split only for incompatible inputs or test setup.
For one migration rule, keep compatible cases in one JSONC fixture. Prefer overrides when they preserve the starting configuration.
Place rule fixtures under the language analyzer's current tests/specs/<group>/<rule>/ hierarchy. The directory group must match the rule declaration.
Use focused source files for parser-dependent cases. Use .jsonc arrays when multiple independent script snippets share the same configuration and module semantics are not required. Use options.json in a subdirectory when tests need different rule configuration.
The test utilities recognize these marker texts in source comments:
should generate diagnostics
should not generate diagnosticsCurrent enforcement:
valid but not invalid must contain one of the expectation markers;invalid or neutral filename without a marker is accepted, but adding the correct marker makes intent explicit;.snap, .json, .jsonc, and .md are exempt from the mandatory valid-file marker check;Put the marker at the top of a primary fixture. Sidecar files with neutral names do not need a marker unless they are independently analyzed as cases.
Use the parser crate's established ok/ and error/ directories. A recovery regression should include valid syntax after the malformed construct to prove the parser resumes at the intended boundary.
Use just qt <parser-package> to inspect a CST during development; do not leave the quick test as the only regression coverage.
Use internal specs for behavior introduced or fixed by the change. External Prettier snapshots record comparison results but do not replace focused internal coverage.
The formatter harness performs its idempotency reformat during one test invocation for eligible files. Inspect both formatted output and any IR shown for a mismatch.
| Changed source | Command |
|---|---|
.ungram grammar | just gen-grammar <lang> |
| Formatter source | just gen-formatter <lang> |
| Lint rule or assist | just gen-rules and just gen-configuration |
| Bindings needed locally | just gen-bindings |
Root AGENTS.md is canonical for which artifacts must be committed and which full outputs CI Autofix may provide.
Do not run just ready in a dirty working tree: the recipe checks for a clean diff before and after its full verification sequence. Use the focused commands required by the current task, then just f and just l.
insta.CONTRIBUTING.md#testinghttps://github.com/mitsuhiko/insta/blob/1.48.0/CHANGELOG.md#1440crates/biome_analyze/CONTRIBUTING.mdcrates/biome_cli/tests/snap_test.rscrates/biome_test_utils/src/lib.rscrates/biome_formatter_test/src/spec.rsjustfile40dd3fb
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.