title: Jest for Sinon Stubs published: true description: tags: #testing #JavaScript #jest #sinon


At work, we recently converted from Mocha, Karma, Chai, and Sinon to Jest. It was not immediately obvious what the direct replacement was for tsx sinon.stub(object, 'methodName').callsFake(() => {}) Found out Jest provides similar functionality with tsx jest.spyOn(object, 'methodName').mockImplementation(() => {})