Comments (2)
Yes that is correct behavior as noted by the README.md:
.rejects(value)
Returns a rejected bluebird promise with the given value.
Note: If the given value is a String, that string will be wrapped in an Error object and will be on the >message property.
I must admit this is a bit of a sore spot for me though, originally I liked the convenience, but looking at it now through a bit more experience I realize I should have probably left that up to the end-user rather than forcing it into a string.
Unfortunately, if I am to change the behavior to no longer auto wrap a string into an Error
object, that would be a major breaking change and we would need to bump the lib up to 2.0.0
. Not sure if I am ready to do that yet.
I will think about this for a little while and get back to you about my decision soon.
from sinon-bluebird.
Okay so I am getting back you and I agree. We should change it, so that passing a String
into .rejects
leaves it unmodified (so no Error
wrapping). Like I said earlier, this will cause a major version bump, but I am okay with that. I will get started on this as soon as I have time.
from sinon-bluebird.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sinon-bluebird.