File tree 1 file changed +3
-8
lines changed
1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -354,7 +354,8 @@ function getSnapshotNotMatchMessage(
354
354
? diffStr ( actualSnapshot , expectedSnapshot )
355
355
: diff ( actualSnapshot . split ( "\n" ) , expectedSnapshot . split ( "\n" ) ) ;
356
356
const diffMsg = buildMessage ( diffResult , { stringDiff } ) . join ( "\n" ) ;
357
- const message = `Snapshot does not match:\n${ diffMsg } ` ;
357
+ const message =
358
+ `Snapshot does not match:\n${ diffMsg } \nTo update snapshots, run\n deno test --allow-read --allow-write [files]... -- --update\n` ;
358
359
return getErrorMessage ( message , options ) ;
359
360
}
360
361
@@ -859,13 +860,7 @@ export async function assertSnapshot(
859
860
if ( equal ( actualSnapshot , expectedSnapshot ) ) {
860
861
return ;
861
862
}
862
- const stringDiff = ! _actual . includes ( "\n" ) ;
863
- const diffResult = stringDiff
864
- ? diffStr ( _actual , snapshot )
865
- : diff ( _actual . split ( "\n" ) , snapshot . split ( "\n" ) ) ;
866
- const diffMsg = buildMessage ( diffResult , { stringDiff } ) . join ( "\n" ) ;
867
- const message =
868
- `Snapshot does not match:\n${ diffMsg } \nTo update snapshots, run\n deno test --allow-read --allow-write [files]... -- --update\n` ;
863
+
869
864
throw new AssertionError (
870
865
getSnapshotNotMatchMessage ( actualSnapshot , expectedSnapshot , options ) ,
871
866
) ;
You can’t perform that action at this time.
0 commit comments