toddbluhm / sinon-bluebird Goto Github PK
View Code? Open in Web Editor NEW[Obsolete] Simple sinon wrapper providing bluebird promise support
License: MIT License
[Obsolete] Simple sinon wrapper providing bluebird promise support
License: MIT License
Recently a new major version of bluebird (3.0.5) was released.
But your library has strict requirement of peerDependency
Can you update your package.json and also release next major version?
Seems like there are no breaking changes
Hi, ideas on how to use with Karma?
It seems sinon is declared as a dependency
. Since we use sinon < 1.12
, sinon-bluebird was getting its own copy in sinon-bluebird/node_modules
, and attaching the new keywords there.
{
"dependencies": {
"bluebird": "^2.9.12",
"sinon": "^1.12.2"
},
"peerDependencies": {
"sinon": "1.x"
}
}
It's also declared as a peerDependency
, which sounds good, so maybe dependencies
is an accident? Since it's used in the tests, should it be a devDependency
instead?
Sinon 2 seems to be unsupported. I get:
TypeError: Cannot set property 'resolves' of undefined
at Object.<anonymous> (...\node_modules\sinon-bluebird\index.js:10:47)
.rejects()
and .returns(Promise.reject())
are returning two different values. I would expect them to return the same, since .resolves()
and .returns(Promise.resolve())
do so.
var sinon = require('sinon-bluebird'),
BPromise = require('bluebird'),
x;
x = sinon.stub().rejects('goodbye');
x().catch(function(err){
console.log(err, typeof err); // [Error: goodbye] 'object'
});
x = sinon.stub().returns(BPromise.reject('goodbye'));
x().catch(function(err){
console.log(err, typeof err); // goodbye string
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.