Plugin for the Unexpected assertion lib adding Promise support. Requires Unexpected 7 or above.
var expect =require('unexpected').installPlugin(require('unexpected-promise'));
it('should DTRT',function(){
returnexpect(myPromise,'to be resolved with','foobar');
});
it('should fail',function(){
returnexpect(myPromise,'to be rejected with',newError('argh'));
});
Alternatively you can use the when resolved and when rejected
assertions to replace the subject with the resolved value or rejection reason,
then apply another assertion to it: