6
我已經完全運行之前興農存根callsFake說法
sinon.stub(console, 'log',() => {
// Check what the arguments holds
// And either console.info it or do nothing
});
例如,添加console.info(arguments)
裏邊有以下存根,會告訴我什麼console.log
是越來越。
隨着2xx
版本我切換到callsFake
:
sinon.stub(console, 'log').callsFake(() => {
// Check what the arguments holds
// And either console.info it or do nothing
});
現在,這再正常工作。 console.info(arguments)
具有集市價值,並且與console.log
傳遞的東西無關。
我在做什麼錯?
嘗試與回報更換callsFake() –