insta-snapshots
This skill guides you through working with insta snapshot tests in the Oxc codebase without requiring terminal interaction.
What are Insta Snapshots?
Insta is a snapshot testing library for Rust. Oxc uses it extensively for:
- Linter rule tests (
crates/oxc_linter/src/snapshots/) - Semantic analysis tests (
crates/oxc_semantic/tests/integration/snapshots/) - Other crate-specific snapshot tests
Snapshots track expected test outputs (often failures or errors). When code changes, new snapshots are generated as .snap.new files for review.
Running Tests and Generating Snapshots
Run tests for a specific crate:
cargo test -p <crate_name>
More from oxc-project/oxc
migrate-oxlint
Guide for migrating a project from ESLint to Oxlint. Use when asked to migrate, convert, or switch a JavaScript/TypeScript project's linter from ESLint to Oxlint.
3.1Kmigrate-oxfmt
Guide for migrating a project from Prettier or Biome to Oxfmt. Use when asked to migrate, convert, or switch a JavaScript/TypeScript project's formatter from Prettier or Biome to Oxfmt.
1.5Kperformance-lint-rules
Tips for writing performant Oxc linter rules. Use only when editing Rust rule implementations under crates/oxc_linter/src/rules/.
6