Switch from ApprovalTests to VerifyTests for golden master testing #406
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.
This replaces ApprovalTests, the library that's being used for golden master testing, with VerifyTests.
This switch is primarily motivated by challenges that have popped up because of how the ApprovalTests library formats the
.received.txt
that it generates. When the file that's generated by ApprovalTests contains multiple lines, for example when the contents of an array are being verified, then ApprovalTests uses the newline character\n
to separate those lines, even when the test is running on a Windows OS while the typical line separator is\r\n
.A secondary benefit is that the output format used by VerifyTests is "based on" JSON. Which makes the files much easier to read the very large amount of data that is being verified by these tests. Hopefully, this will provide benefits when tracking down bugs that might result in a single value in the file being incorrect.