使用Sinon,我们可以把任何JavaScript函数替换成一个测试替身。 ... function() { var callback = sinon.spy(); myFunction(true, callback); sinon.assert.
確定! 回上一頁