mirror of
https://github.com/oven-sh/bun
synced 2026-02-13 04:18:58 +00:00
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.