or if you have a testing framework that follows the UncommonJS specification for handling promises, simply
return expect.promise(doSumAsync(2, 2).be(4);
Do you think this feature should be in core, an extension, or a fork? And what about the api, should we use expect.promise(myPromise), or expect(myPromise) and expect checks duck-type for thenable.
Heavily inspired by chai-as-promised Instead of manually wiring up your expectations to a promise's fulfilled and rejected handlers:
you can write code that expresses what you really mean:
or if you have a testing framework that follows the UncommonJS specification for handling promises, simply
Do you think this feature should be in core, an extension, or a fork? And what about the api, should we use
expect.promise(myPromise)
, orexpect(myPromise)
andexpect
checks duck-type forthen
able.Btw, I can work on this and make PR