Search code examples
ava

ava support for snapshot property matchers


Does ava support snapshot property matchers?

I am using ava snapshots to test an API endpoint that returns a JSON object. The response contains some properties that are unique to the request (e.g. timestamp, request id).

I know that Jest allows to use property matchers so a property can match to any value. I wonder if ava supports this as well.


Solution

  • It does not. Your best bet is to use destructuring to remove the changing values before you snapshot.