Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluebird promises support #169

Closed
iongion opened this issue Sep 28, 2016 · 2 comments
Closed

Bluebird promises support #169

iongion opened this issue Sep 28, 2016 · 2 comments

Comments

@iongion
Copy link

iongion commented Sep 28, 2016

The then-ability check for promise should be improved to also support Bluebird promises:

        function assertIsAboutPromise(assertion) {
            if (typeof assertion._obj.then !== "function") {
                throw new TypeError(utils.inspect(assertion._obj) + " is not a thenable.");
            }
            if (isLegacyJQueryPromise(assertion._obj)) {
                throw new TypeError("Chai as Promised is incompatible with thenables of jQuery<3.0.0, sorry! Please " +
                                    "upgrade jQuery or use another Promises/A+ compatible library (see " +
                                    "http://promisesaplus.com/).");
            }
        }

...

        function getBasePromise(assertion) {
            return typeof assertion.then === "function" ? assertion : assertion._obj;
        }

The then-ability tests are done in these functions only so a PR might be easy and arrive very soon, what do you think ?

@domenic
Copy link
Collaborator

domenic commented Sep 28, 2016

Why do Bluebird promises fail these tests? My understanding is that they have a .then method.

@domenic
Copy link
Collaborator

domenic commented Oct 8, 2016

Closing due to lack of response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants