Finally someone said it, and I am not feeling like the only one who thinks like this. I have no big experience in writing tests for react, but I wanted to learn it, and wrote a few snapshot tests and I got the same conclusion. I simply dont see the point of snapshot testing, because, if component is changed that probably means that I changed it for a reason, and I would regenerate all the snapshots, anyway.
The only thing that makes me think that this testing makes sense is if for example you update react itself or some other libraries that are maybe generating components. So they render components differently. But then again, I would probably just update snapshots. 🤔
Yes exactly. Plus updating a snapshot solved all the problems in the test - what if there are 2 faults? A regular test would contain 2 expects that will fail independently, and fixing one might not be enough.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Finally someone said it, and I am not feeling like the only one who thinks like this. I have no big experience in writing tests for react, but I wanted to learn it, and wrote a few snapshot tests and I got the same conclusion. I simply dont see the point of snapshot testing, because, if component is changed that probably means that I changed it for a reason, and I would regenerate all the snapshots, anyway.
The only thing that makes me think that this testing makes sense is if for example you update react itself or some other libraries that are maybe generating components. So they render components differently. But then again, I would probably just update snapshots. 🤔
Yes exactly. Plus updating a snapshot solved all the problems in the test - what if there are 2 faults? A regular test would contain 2
expect
s that will fail independently, and fixing one might not be enough.