Jest Mock module per test

后端 未结 4 1439
天命终不由人
天命终不由人 2020-12-13 02:25

I am quite confused with mocking in Jest an how to unit test the implementations. The thing is i want to mock different expected behaviours.

Is there any way to ach

4条回答
  •  萌比男神i
    2020-12-13 02:46

    spyOn worked best for us. See previous answer:

    https://stackoverflow.com/a/54361996/1708297

提交回复
热议问题