From 36ecc3f6d21366dc35cfc667300a244558f992cc Mon Sep 17 00:00:00 2001 From: Lukas Taegert Date: Wed, 7 Jun 2017 11:38:59 +0200 Subject: [PATCH] fix(readme): Provide correct import instructions --- .travis.yml | 2 +- README.md | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0cf2c78..c53c381 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/README.md b/README.md index 26584fd..069ca66 100644 --- a/README.md +++ b/README.md @@ -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)