DEV Community

Discussion on: My "Whoa, I didn't know that!" moments with Jest

Collapse
 
gualison profile image
Alberto Gualis

Great post! Thank you!

I'll also add one little tip for "#3. Snapshot testing on a non-UI elements":

you can replace toMatchSnapshot() by .toMathInlineSnapshot() (check jestjs.io/docs/en/snapshot-testing...) so jest will automatically write all the expected values in your tests file so it's easier to review them (it will even pretty-format them if you use prettier!)

Happy testing!