javascript - Jest spyOn function called - Stack Overflow
https://stackoverflow.com/questions/44769404/jest-spyon-function-called
WEBJun 27, 2017 · When you use the spy, you have two options: spyOn the App.prototype, or component component.instance(). const spy = jest.spyOn (Class.prototype, "method") The order of attaching the spy on the class prototype and rendering (shallow rendering) your instance is important. const spy = jest.spyOn(App.prototype, "myClickFn");
DA: 54 PA: 65 MOZ Rank: 30