sinon-stub-promise
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -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; |
{ | ||
"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); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11158
280