Files
bun.sh/test/js
Claude Bot ef079eb55c feat: preserve unfiltered snapshots when using --test-name-pattern
When using --test-name-pattern (-t) with --update-snapshots (-u),
the snapshot file now only updates snapshots for tests that actually
ran, preserving snapshots for tests that were filtered out.

This prevents accidentally deleting snapshots when iterating on a
subset of tests during development.

Implementation:
- Track which snapshots are accessed during test execution
- When test filter is active with update mode, read existing snapshots
- Reconstruct snapshot file from hashmap, including both accessed
  (potentially updated) and unaccessed (preserved) snapshots
- Sort snapshots by name for deterministic output
- No behavior change for normal (non-filtered) usage

Includes regression test to verify the feature works correctly.
2025-10-04 12:03:26 +00:00
..