0
我的代碼:類型錯誤:試圖包裹這已經是包裹
before(function _before() {
this.myObject = new MyObject();
});
it('should', sinon.test(function() {
const stubLog = sinon.stub(this.myObject.log, 'warn');
}));
it('should 2', sinon.test(function() {
const stubLog = sinon.stub(this.myObject.log, 'warn');
}));
興農版本:1.17.6
爲什麼我應在2測試得到了錯誤TypeError: Attempted to wrap warn which is already wrapped
?我應該手動恢復stubLog
嗎?我認爲sinon.test()
會爲我做。也許我做錯了什麼?
歡迎任何評論。謝謝