Skip to content

Commit

Permalink
Merge pull request #70 from shaunc/patch-1
Browse files Browse the repository at this point in the history
Minimal fixup of documentation
  • Loading branch information
fatso83 committed May 25, 2017
2 parents 6f1c3e8 + 1c3e542 commit 0f50f53
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,18 @@ version can be found in the NPM package under `dist/sinon-test.js`.

## Usage

See the [sinon documentation](http://sinonjs.org/docs/#sinon-test) for documentation on usage.
Once initialized, the package creates a context for your test based on a sinon sandbox.
You can use `this` in a wrapped test function to create sinon spies, stubs, etc.
After your test completes, the sandbox restores anything modified to its original value.

`sinon-test` instances need to be configured with a `sinon` instance (version 2+) before they can be used; you can emulate the sinon 1.x methods with the following:
If your test function takes any arguments, pass then to the `test` wrapper
after the test function. If the last argument is a function, it is assumed to be a callback
for an asynchronous test. The test function may also return a promise.

See the [sinon documentation](http://sinonjs.org/) for more documentation on sandboxes.

`sinon-test` instances need to be configured with a `sinon` instance (version 2+)
before they can be used.

```js
var sinon = require('sinon');
Expand Down

0 comments on commit 0f50f53

Please sign in to comment.