{"enrichment":{"faq":[{"a":"testing-codegen helps you execute snapshot tests using insta. Run `cargo test` in the relevant crate to trigger snapshot tests. For faster iteration, use `cargo test quick_test` to run a focused subset. When snapshots differ from expected output, insta prompts you to review and accept or reject changes interactively. This workflow is essential for testing lint rules and validating parser behavior.","q":"How do I run snapshot tests in Biome?"},{"a":"testing-codegen covers the complete insta snapshot cycle in Biome. Write test cases, run `cargo test`, and insta captures actual output as snapshots. Review diffs in your terminal or editor\u2014accept changes with `cargo insta accept` or reject them. For cleanup, use `cargo insta test --unreferenced delete` to prune orphaned snapshot files. This iterative process ensures lint rules, formatters, and analyzers produce correct output.","q":"What is the Biome insta snapshot testing workflow?"},{"a":"testing-codegen supports rapid AST inspection via the quick-test workflow. Use `cargo test quick_test` to run focused parser tests and examine output. Add the `dbg` macro in test code to print intermediate values. Organize test files in the `specs` folder with clear naming conventions so you can locate and modify parser tests efficiently. This approach accelerates debugging during parser development.","q":"How can I quickly inspect AST structure and debug parser behavior?"},{"a":"testing-codegen explains that `just gen-rules` regenerates code for analyzers, formatters, and grammar after you modify rule definitions or parser logic. Run this command to automatically generate updated analyzer implementations and formatter code. Pair it with snapshot testing to validate that generated code produces expected output, ensuring consistency across the codebase.","q":"What does the Biome 'just gen-rules' command do?"},{"a":"testing-codegen guides you through Biome's test file structure and naming conventions. Store tests in the `specs` folder with descriptive names that reflect the rule or feature being tested. Include comments in test files to document test-specific options and expected behavior. Follow the convention of grouping valid and invalid test cases together, making it easy for the test runner to validate both passing and failing scenarios.","q":"How should I name and organize test files in Biome?"},{"a":"testing-codegen covers snapshot maintenance with insta. After refactoring or removing tests, orphaned snapshot files may remain. Run `cargo insta test --unreferenced delete` to automatically identify and remove snapshots no longer referenced by active tests. This keeps your snapshot directory clean and prevents confusion during code review. Always review the list of files to be deleted before confirming.","q":"How do I manage and prune orphaned snapshot files?"}],"shadow_tags":["snapshot-testing","code-generation","ast-inspection","test-fixtures","parser-development","lint-rule-testing","ci-automation","diagnostic-validation","grammar-codegen","test-conventions"],"summary_rewrite":"testing-codegen guides you through snapshot testing with insta and code generation for the Biome codebase. It covers running tests for specific crates, fast iteration with quick-test workflows, and safely managing snapshots\u2014including pruning orphaned files and reviewing changes interactively. Use this skill when testing lint rules, inspecting AST structure, or regenerating parser and analyzer code."},"files":[{"bytes":12617,"path":".claude/skills/testing-codegen/SKILL.md","sha256":"3805c64de39c047dd1ba5252b2a6c6e375604f2a8edfeb43a0fca71c73c2bd57","url":"https://skillfed.io/files/biomejs/biome/testing-codegen/c82a542b/SKILL.md"}],"id":"biomejs/biome/testing-codegen","links":{"html":"https://skillfed.io/biomejs/biome/testing-codegen","md":"https://skillfed.io/biomejs/biome/testing-codegen.md","repo":"https://github.com/biomejs/biome"},"meta":{"agents_supported":["claude-code"],"first_seen":"2026-07-28","forks":1157,"language":"Rust","last_updated":"2026-07-27","license":"Apache-2.0","name":"testing-codegen","publisher":"biomejs","stars":25418},"relations":{"similar":[{"id":"biomejs/biome/lint-rule-development"},{"id":"biomejs/biome/pull-request"},{"id":"biomejs/biome/eslint-migrate-options"},{"id":"biomejs/biome/formatter-development"},{"id":"biomejs/biome/parser-development"},{"id":"biomejs/biome/diagnostics-development"},{"id":"biomejs/biome/biome-developer"},{"id":"oxc-project/oxc/insta-snapshots"},{"id":"notque/vexjoy-agent/code-linting"},{"id":"biomejs/biome/changeset"}]},"slug":{"owner":"biomejs","repo":"biome","skill":"testing-codegen"},"version":"c82a542b"}
