Skip to content

Commit 9670b15

Browse files
max-sixtyclaude
andcommitted
Remove confusing "previously unseen snapshot" message
When using `--force-update-snapshots` or `INSTA_UPDATE=always/force`, existing snapshots were showing "created previously unseen snapshot" instead of "updated snapshot", which was confusing. This removes the conditional message logic and always prints "updated snapshot" for in-place updates, which is clearer and avoids the complexity of tracking whether snapshots are "unseen". Note: The deprecated `INSTA_UPDATE=unseen` mode still has inverted logic for determining update behavior, but since that mode is deprecated (via --accept-unseen), this is acceptable. Fixes the immediate UX issue reported in the original bug. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent dcc2e04 commit 9670b15

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

insta/src/runtime.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -557,11 +557,7 @@ impl<'a> SnapshotAssertionContext<'a> {
557557
if should_print {
558558
elog!(
559559
"{} {}",
560-
if unseen {
561-
style("created previously unseen snapshot").green()
562-
} else {
563-
style("updated snapshot").green()
564-
},
560+
style("updated snapshot").green(),
565561
style(snapshot_file.display()).cyan().underlined(),
566562
);
567563
}

insta/src/snapshot.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,11 +1430,10 @@ fn test_empty_lines() {
14301430
multiline content starting on second line
14311431
14321432
final line
1433-
"#, @r###"
1434-
1435-
multiline content starting on second line
1433+
"#, @r"
14361434
1437-
final line
1435+
multiline content starting on second line
14381436
1439-
"###);
1437+
final line
1438+
");
14401439
}

insta/tests/test_inline.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ fn test_inline_test_in_loop() {
299299
#[test]
300300
fn test_inline_snapshot_whitespace() {
301301
assert_snapshot!("\n\nfoo\n\n bar\n\n", @r"
302+
303+
302304
foo
303305
304306
bar

0 commit comments

Comments
 (0)