Skip to content

Commit

Permalink
fix(readme): Provide correct import instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Jun 7, 2017
1 parent 76466a9 commit 36ecc3f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ before_install:
- npm i -g npm@~4.0.0
before_script:
- npm prune
script:
- node build
script:
- istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- -R spec
- codecov
after_success:
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,22 @@ Thus you can test for all instances separately which methods have been invoked i
`this`-value if you need to stub a [fluent interface](https://en.wikipedia.org/wiki/Fluent_interface).
* As the prototype is not modified, you do not have to clean up your stubs after the test!

## Installation
```bash
npm install --save-dev sinon-helpers
```

or

```bash
yarn add --dev sinon-helpers
```

## Usage
```javascript
var sh = require('sinon-helpers') // CommonJS
import sh from 'sinon-helpers' // ES6
import * as sh from 'sinon-helpers' // ES6
// alternative: import {getStubConstructor, getSpyConstructor, returning} from 'sinon-helpers'

// Create a constructor mimicking a given constructor
var MyStubConstructor = sh.getStubConstructor(MyConstructor)
Expand Down

0 comments on commit 36ecc3f

Please sign in to comment.