snapshooter icon indicating copy to clipboard operation
snapshooter copied to clipboard

Snapshot MatchOption Exclude

Open nscheibe opened this issue 3 years ago • 1 comments

At the moment the snapshot match option "ignore" serializes the value of a field of a snapshot and just ignores this value during comparison. Now we should have the possibility to exclude a certain field completely. The excluded field shall not be serialized within the snapshot and of course shall not be compared.

Example: Snapshot.Match(object, matchOptions => matchOptions.ExcludeField("<jsonPath>"))

nscheibe avatar Nov 29 '20 17:11 nscheibe

Thx to @glucaci for the feature request

nscheibe avatar Nov 29 '20 17:11 nscheibe

Bump. I would love this too. It will make diff'ing the mismatch less confusing. Maybe there's something that can be done on the serializer itself to not include it at all

relfman-cmg avatar Nov 15 '22 02:11 relfman-cmg

I added it already with PR #163

We will create a release tonight, then its in.

nscheibe avatar Nov 15 '22 12:11 nscheibe

Version 0.10.0

nscheibe avatar Nov 16 '22 15:11 nscheibe