Skip to content

Exceptions and Help messages on duplicate verify() calls.

Compare
Choose a tag to compare
@isidore isidore released this 15 Oct 20:22
· 346 commits to main since this release

ApprovalTests only wants one call to verify() per test.

There are ways to go around this but if you call verify where it would want the exact same file name twice, it will now throw an exception.
This will make it easier for people to not be confused as most other testing frameworks allow you to put multiple assertions in the same test.

Backwards compatibility

There are some situations where you want to check that two different processes produce the same result.
Calling verify multiple times in the same test can be a way to do this.
If you want to do that, we have provided the following:

approvals.settings().allow_multiple_verify_calls_for_this_method()