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

sinon-stub-promise

Package Overview
Dependencies
Maintainers
1
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 0.0.3 to 0.0.4

5

index.js

@@ -37,3 +37,6 @@

finally: function() {
finally: function(callback) {
if (this.resolved || this.rejected) {
callback();
}
}

@@ -40,0 +43,0 @@ };

2

package.json
{
"name": "sinon-stub-promise",
"version": "0.0.3",
"version": "0.0.4",
"description": "Synchronous Promise stubbing for Sinon.JS",

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

@@ -142,2 +142,33 @@ var sinon = require('sinon');

it('does not invoke finally if promise is not resolved or rejected', function() {
var finallyCalled = false;
promise().finally(function() {
finallyCalled = true;
});
expect(finallyCalled).to.be.false;
});
it('invokes finally when promise is resolved', function() {
promise.resolves();
var finallyCalled = false;
promise().finally(function() {
finallyCalled = true;
});
expect(finallyCalled).to.be.true;
});
it('invokes finally when promise is rejected', function() {
promise.rejects();
var finallyCalled = false;
promise().finally(function() {
finallyCalled = true;
});
expect(finallyCalled).to.be.true;
});
describe('chaining', function() {

@@ -144,0 +175,0 @@ it('supports then chaining', function(done) {

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