Giter Club home page Giter Club logo

Comments (2)

toddbluhm avatar toddbluhm commented on May 28, 2024 1

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.

toddbluhm avatar toddbluhm commented on May 28, 2024 1

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.