Answers for "Mocha / Chai expect.to.throw error"

1

Mocha / Chai expect.to.throw error

You have to pass a function to stub. Like this:
     const findOneAndUpdateStub = sinon
       .stub(Client, "findOneAndUpdate")
       .throws(new Error(""));
Posted by: Guest on October-23-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language