Jest Snapshot testing vs unit testing?

后端 未结 3 652
被撕碎了的回忆
被撕碎了的回忆 2021-02-12 15:59

It\'s fairly easy to implement snapshot testing in jest but it\'s something I am not really comfortable with because it feels like I am not actually testing anything. In unit te

3条回答
  •  面向向阳花
    2021-02-12 16:30

    Thanks to everyone on this thread. I'm fairly new to React, but just started looking at unit testing it, and was wondering the same thing. Like, if I have an address component where the only real logic in it would be whether to render the address inline, or postal style. I decided on Snapshot testing here. But when it comes to validating interactivity and state change, then I guess that's where enzyme comes in, along with more standard, non-ui testing.

提交回复
热议问题