I am getting error:
- TypeError: Attempted to wrap ajax which is already wrapped
Error: Stack Trace for original chai.should();
describe("Test API", function() { it('executes a GET request for ISPs', function() { var mySpy = sinon.spy(jQuery, "ajax"); sinon.stub(jQuery, 'ajax'); mySpy.should.have.been.calledWithMatch({ url: 'http://data-api.measurementlab.net/locations/nausdcwashington/clients' }); }); after(function() { jQuery.ajax.restore(); }); });
I came across similar posts and added the after
block. Still getting the same error: Sinon.js- Trying to spy on console.log but it is already wrapped