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.7 to 0.0.8

5

index.js

@@ -1,3 +0,1 @@

function buildThenable() {

@@ -21,2 +19,5 @@ return {

} catch(error) {
if (error.constructor.name.match(/AssertionError/)) {
throw error;
}
this.rejectValue = error;

@@ -23,0 +24,0 @@ this.rejected = true;

4

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

@@ -18,3 +18,3 @@ "author": "Alex May <alex@substantial.com>",

"devDependencies": {
"chai": "^1.10.0",
"chai": "^2.3.0",
"mocha": "^2.1.0",

@@ -21,0 +21,0 @@ "rsvp": "^3.0.16",

var sinon = require('sinon');
var sinonStubPromise = require('../index');
var AssertionError = require('chai').AssertionError;
var expect = require('chai').expect;

@@ -254,3 +255,15 @@ var RSVP = require('rsvp');

});
it('throws error if assertion error', function() {
promise.resolves();
function throwError() {
throw new AssertionError();
}
expect(function() {
promise().then(throwError)
}).to.throw(AssertionError);
});
});
});
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