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

sinon-stub-promise

Package Overview
Dependencies
Maintainers
5
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sinon-stub-promise - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

4

index.js

@@ -14,3 +14,5 @@ function buildThenable() {

// update resolve value for next promise in chain
this.resolveValue = returned;
if (returned !== undefined) {
this.resolveValue = returned;
}

@@ -17,0 +19,0 @@ return this;

{
"name": "sinon-stub-promise",
"version": "1.0.1",
"version": "1.1.0",
"description": "Synchronous Promise stubbing for Sinon.JS",

@@ -5,0 +5,0 @@ "author": "Alex May <alex@substantial.com>",

@@ -32,2 +32,17 @@ var sinon = require('sinon');

});
it('can resolve multiple times with the same value', function() {
var secondResolvedValue = null;
promise.resolves('resolve value');
promise().then(function(arg) {
resolveValue = arg;
});
expect(resolveValue).to.equal('resolve value');
promise().then(function(arg) {
secondResolvedValue = arg;
});
expect(secondResolvedValue).to.equal('resolve value');
});

@@ -34,0 +49,0 @@ it('can resolve empty value', function() {

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