Use Snapshotting strategies
mainThe Snapshotting type defines how to convert a value into a format that can be snapshotted and compared. The library provides a wide variety of built-in strategies for different data types and representations:
- Visuals:
image(with options forprecision,perceptualPrecision,size, anddrawingMode). - Textual/Structural:
dump,description,recursiveDescription,elementsDescription, andlines. - Data Formats:
json,plist,data,curl, andraw.
Use these strategies within your assertSnapshot calls to specify what aspect of your type you want to test.