swift-snapshot-testing icon indicating copy to clipboard operation
swift-snapshot-testing copied to clipboard

Add option to dump all children

Open tahirmt opened this issue 3 years ago • 0 comments

Adding an option to dump to render all children without requiring implementations for the AnySnapshotStringConvertible protocol default value.

Also create several other protocols to control how children are processed for the dump. Not too happy with the naming so happy to change thaat

  • AnySnapshotStringConvertibleIncludedNodesProvider: Adds an option to choose which nodes to include from the children. If a type implements this protocol it can provide an array of children to include in the dump
  • AnySnapshotStringConvertibleExcludedNodesProvider: Adds an option to exclude select children from the dump. Useful when a type has unnecessary properties we want to exclude from the dump
  • AnySnapshotStringConvertibleDumpChildNodes: When this is implemented children will be included for AnySnapshotStringConvertible such as NSObject subclasses
  • AnySnapshotStringConvertibleIgnoreChildNodes: Implementing types will ignore all children from the dump.

This is also a solution to #596

tahirmt avatar Apr 08 '22 03:04 tahirmt