Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stub-promise-function

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stub-promise-function - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

11

example.js

@@ -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');

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc