I would like to stub out a library I am using, which I instantiate with a new call, however, I have not been able to find how to do this. This is the specific line I am talking about: https://github.com/reviewninja/review.ninja/blob/f8717690aeb1288e668f835d36bcabe7e6b21b0c/src/server/services/github.js#L11 I want to stub out that call to be able to check if my service interacts correctly with the library. Any idea how to do that? The problem is not stubbing out itself, stubbing out any other function on an object is no problem with sinon, however the new call seems to be special.