我正在錯誤:柴+興農錯誤:方法已包裹
- 類型錯誤:嘗試包裹AJAX其已經包裹
錯誤:堆棧跟蹤原始 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(); }); });
我碰到類似的帖子,並添加了after
塊。仍然得到相同的錯誤:Sinon.js- Trying to spy on console.log but it is already wrapped