var stub = sinon.stub(object, "method");. 用存根函数替换 object.method 。如果该属性还不是函数,则抛出异常。 可以通过调用 object.method.restore(); 来恢复原始 ...
確定! 回上一頁