🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
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

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() {