Skip to content
This repository was archived by the owner on Oct 6, 2018. It is now read-only.
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions resources/docs/spies-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ contrived example:
original method in all cases. The original method can be restored by calling
<code>object.method.restore()</code>. The returned spy is the function
object which replaced the original method. <code>spy === object.method</code>.
This method also works on getters and setters.
</dd>
</dl>

Expand Down
4 changes: 4 additions & 0 deletions resources/docs/stubs.edn
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
:description "Replaces `object.method` with a `func`, wrapped
in a `spy`. As usual, `object.method.restore();`
can be used to restore the original method."}
{:name "var stub = sinon.stub(object, \"getter\", property);"
:description "Replaces `object.getter` with a new function which returns
`property`, also wrapped in a `spy`. As usual, `object.method.restore();`
can be used to restore the original method."}
{:name "var stub = sinon.stub(obj);"
:description "Stubs all the object's methods. Note that it's usually better
practice to stub individual methods, particularly on
Expand Down