sinon-with-promise
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "sinon-with-promise", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Sugar methods for using sinon.js stubs and spies with promises", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,6 +9,6 @@ sinon-with-promise | ||
```sh | ||
npm install sinon-as-promised | ||
npm install sinon-with-promise | ||
``` | ||
If you're using sinon-as-promised in the browser and are not using Browserify/Webpack, use [3.x](https://github.com/bendrucker/sinon-as-promised/tree/v3.0.1) or earlier. | ||
If you're using sinon-with-promise in the browser and are not using Browserify/Webpack, use [3.x](https://github.com/bendrucker/sinon-as-promised/tree/v3.0.1) or earlier. | ||
@@ -21,3 +21,3 @@ ## Usage | ||
var sinon = require('sinon') | ||
require('sinon-as-promised') | ||
require('sinon-with-promise') | ||
@@ -33,3 +33,3 @@ sinon.stub().resolves('foo')().then(function (value) { | ||
var sinon = require('sinon') | ||
require('sinon-as-promised') | ||
require('sinon-with-promise') | ||
@@ -48,3 +48,3 @@ var spy = sinon.spy().resolves('foo') | ||
You'll only need to require sinon-as-promised once. It attaches the appropriate stubbing functions which will then be available anywhere else you require sinon. It defaults to using native ES6 Promise [(or provides a polyfill)](https://github.com/getify/native-promise-only), but you can use another promise library if you'd like, as long as it exposes a constructor: | ||
You'll only need to require sinon-with-promise once. It attaches the appropriate stubbing functions which will then be available anywhere else you require sinon. It defaults to using native ES6 Promise [(or provides a polyfill)](https://github.com/getify/native-promise-only), but you can use another promise library if you'd like, as long as it exposes a constructor: | ||
@@ -54,3 +54,3 @@ ```js | ||
var Bluebird = require('bluebird') | ||
require('sinon-as-promised')(Bluebird) | ||
require('sinon-with-promise')(Bluebird) | ||
``` | ||
@@ -57,0 +57,0 @@ |
8259