Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type: feature
The following has been addressed in the PR:
prettieras per the readme code style guidelinesDescription:
Asserting full render functions can be brittle and end up encapsulating lots of logic in tests. While asserting only portions of a render function does not potentially cover everything (because a render function is the smallest unit).
To solve the above problems, Assertion Templates allow the user to always assert against a full render, while allowing them to easily modify the assertion themselves per scenario.
The AssertionTemplate uses the existing selector api used elsewhere in harness, and supports an additional magic
~keyselector which is erased on render, this allows the user to select nodes in the AssertionTemplate, without the key being in the actual render result itself.The api for AssertionTemplate is very simple with the following api's:
AssertionTemplates are always immutable, setting a value will always result in a new AssertionTemplate being returned. This allows you to use assertions that build on top of other assertions.
Resolves #190