Je reçois l'erreur:Chai + erreur Sinon: méthode est déjà enveloppé
- TypeError: Tentative d'envelopper ajax qui est déjà enveloppé
Erreur: Stack Trace pour origine 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(); }); });
je suis tombé sur des postes similaires et a ajouté le bloc after
. Toujours obtenir la même erreur: Sinon.js- Trying to spy on console.log but it is already wrapped