If you're going to mock out other functions you don't own, use the sinon mocking framework we've already taken a dependency on instead of doing this yourself.