stub-promise-function
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -0,5 +1,3 @@ | ||
var stubPromiseFunction = require('stub-promise-function'); | ||
var stubPromise = require('stub-promise'); | ||
// code under test | ||
@@ -16,3 +14,3 @@ function getUsers() { | ||
beforeEach(function() { | ||
http.get = stubPromise(); | ||
http.get = stubPromiseFunction(); | ||
sinon.spy(console, 'log'); | ||
@@ -25,2 +23,7 @@ }); | ||
it('uses http to get users', () => { | ||
expect(http.get.called).toBe(true); | ||
expect(http.get.getCall(0).args[0]).toBe('/users.html'); | ||
}); | ||
describe('when getUsers resolves', function() { | ||
@@ -27,0 +30,0 @@ |
{ | ||
"name": "stub-promise-function", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "A test utility that lets you stub and control promises for testing purposes", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/jonbern/stub-promise-function.git", |
@@ -34,2 +34,7 @@ # stub-promise-function | ||
it('uses http to get users', () => { | ||
expect(http.get.called).toBe(true); | ||
expect(http.get.getCall(0).args[0]).toBe('/users.html'); | ||
}); | ||
describe('when getUsers resolves', function() { | ||
@@ -67,3 +72,3 @@ | ||
http = { | ||
get: stubPromise() | ||
get: stubPromiseFunction() | ||
}; | ||
@@ -146,3 +151,3 @@ }); | ||
http = { | ||
get: stubPromise() | ||
get: stubPromiseFunction() | ||
}; | ||
@@ -163,3 +168,3 @@ | ||
it('can be reinstantiated and then resolved', function() { | ||
http.get = stubPromise(); | ||
http.get = stubPromiseFunction(); | ||
@@ -166,0 +171,0 @@ promise = http.get('http://another'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9239
134
183