-
Notifications
You must be signed in to change notification settings - Fork 155
Open
Description
Context: I'm testing a Promise created using PromiseKit
What I have now:
promise.then(^(id result){
expect(result).to.equal(expected);
}).catch(^(NSError *error){
failure(error);
}).finally(^(){
done();
});
which the lazy old me use as a macro
#define AssertPromise(promise, expected) promise.then(^(id result){ expect(result).to.equal(expected);}).catch(^(NSError *error){ failure(error);}).finally(^(){done();});
What I wanted (similar library in JS: https://github.com/domenic/chai-as-promised/):
expect(promise).to.be.resolvedAs(expected)
Currently I am stuck on implementing the match method of EXPMatcher since it expects a boolean, but then we need to wait until the promise get resolved.
Would this kind of api be possible? Any kind of direction would be nice :)
Cheers,
Metadata
Metadata
Assignees
Labels
No labels