The chai-as-promised docs have the following example of dealing with multiple promises in the same test:
it("should all be well", function (done) {
Q.all([
promiseA.should.become("happy"),
promiseB.should.eventually.have.property("fun times"),
promiseC.should.be.rejectedWith(TypeError, "only joyful types are allowed")
]).should.notify(done);
});
I assume that the Q
here has come from npm install q
and var Q = require('q');
.
Where does .should
come from?
When I try this should
is undefined
and I get TypeError: Cannot call method 'notify' of undefined
.
Is there some monkey patching of Q
that's supposed to happen first? Or am I using the wrong version of something?
I'm using cucumber with protractor. As I understand it they don't support returning promises yet so the user has to handle the call to done
.