Skip to content
This repository was archived by the owner on Mar 28, 2018. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,9 @@ <h3 id="stubs-api">Stub API</h3>
<dd>
Replaces <code>object.method</code> with a stub function. The original
function can be restored by calling <code>object.method.restore();</code>
(or <code>stub.restore();</code>). An exception is thrown if the property
is not already a function, to help avoid typos when stubbing methods.
(or <code>stub.restore();</code> and <code>sinon.restore(stub);</code>).
An exception is thrown if the property is not already a function, to
help avoid typos when stubbing methods.
</dd>
<dt><code>var stub = sinon.stub(object, "method", func);</code></dt>
<dd>
Expand All @@ -471,7 +472,8 @@ <h3 id="stubs-api">Stub API</h3>
If you want to create a stub object of <code>MyConstructor</code>,
but don't want the constructor to be invoked, use this utility
function:
<pre><code>var stub = sinon.createStubInstance(MyConstructor)</code></pre>
<pre><code>var stub = sinon.createStubInstance(MyConstructor)</code></pre><br>
Stubbed objects can be restored by <code>sinon.restore(obj);</code>
</dd>
<dt><code>stub.withArgs(arg1[, arg2, ...]);</code></dt>
<dd>
Expand Down Expand Up @@ -1611,6 +1613,11 @@ <h2>Sinon.JS utilities</h2>
stubs all implemented functions. The given constructor function is
not invoked. See also the <a href="#stubs">stub API</a>.
</dd>
<dt><code>sinon.restore(obj)</code></dt>
<dd>
Restores the supplied stub, spy, or restorable methods of a stubbed
object.
</dd>
<dt><code>sinon.format(object)</code></dt>
<dd>
Formats an object for pretty printing in error messages. Sinon < 1.3.0
Expand Down