Sinon error Attempted to wrap function which is already wrapped
You should restore the getObj in after() function, please try it as below. describe(‘App Functions’, function(){ var mockObj; before(function () { mockObj = sinon.stub(testApp, ‘getObj’, () => { console.log(‘this is sinon test 1111’); }); }); after(function () { testApp.getObj.restore(); // Unwraps the spy }); it(‘get results’,function(done) { testApp.getObj(); }); }); describe(‘App Errors’, function(){ var mockObj; … Read more