Loading...
Loading...
Guide for working with and updating insta snapshot tests in Oxc without terminal interaction.
npx skill4agent add oxc-project/oxc insta-snapshotscrates/oxc_linter/src/snapshots/crates/oxc_semantic/tests/integration/snapshots/.snap.newcargo test -p <crate_name>.snap.newcargo insta reviewcargo insta pending-snapshots
# Or for workspace-wide:
cargo insta pending-snapshots --workspace.snap.new.snap.new.snapcargo insta pending-snapshotscargo insta accept
# Or workspace-wide:
cargo insta accept --workspacecargo insta accept --snapshot <snapshot_name>cargo insta reject
# Or workspace-wide:
cargo insta reject --workspace.snap.new.snap.new.snapgit diff <path/to/snapshots/>cargo test -p oxc_lintercargo insta pending-snapshotscargo insta accept.snapcargo test -p oxc_linter specific_test_namecargo insta pending-snapshotsspecific_test_name.snap.newcargo insta accept -p oxc_linter.snap.snap.new.snap.mdgit diff.snap# 1. Make a code change to a linter rule
# 2. Run tests
cargo test -p oxc_linter
# 3. See what changed
cargo insta pending-snapshots
# 4. Review specific snapshot (using Read tool)
# Read: crates/oxc_linter/src/snapshots/some_test.snap.new
# 5. Accept if correct
cargo insta accept -p oxc_linter
# 6. Verify with git
git diff crates/oxc_linter/src/snapshots/
# 7. Run tests again to ensure everything passes
cargo test -p oxc_linter