You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to test whether add method is called or not. I have tried these ways but all are giving the same error.
it('add should be called',()=>{consttex=createTeX('2^2');constspy=jest.spyOn(tex,'add');tex.add();expect(spy).toHaveBeenCalled();//expect(tex.position()).toEqual([10, 20]);});
it('add should be called',()=>{consttex=createTeX('2^2');constelement=createDiv();global.createDiv=function(html){returnelement}constspy=jest.spyOn(tex,'add');tex.add();expect(spy).toHaveBeenCalled();//expect(tex.position()).toEqual([10, 20]);});
it('play should be called',()=>{consttex=createTeX('2^2');constspy=jest.spyOn(tex,'play').mockImplementation(()=>{});tex.play();expect(spy).toHaveBeenCalled();});
I want to test whether
add
method is called or not. I have tried these ways but all are giving the same error.other working tests in commit : 0ed4891
The text was updated successfully, but these errors were encountered: