Content
@
0 reply
0 recast
2 reactions
greg
@gregfromstl
I'm surprised more devs don't use this. Any time we need to test complex outputs like transaction objects, hashes, or errors, we use toMatchInlineSnapshot (which works in Vitest and Jest). As soon as a test runs, toMatchInlineSnapshot's parameter will be auto-filled with the provided value. On all future test runs, it'll verify that the value remains unchanged. So if you're expecting a change to the output of a function, you can easily update all tests. If you're not expecting a change, the test will let you know 👹 (example from ox by @wevm)
0 reply
0 recast
1 reaction