converting to use sinon.stub