I think we should be using sinon for these tests