Closed brendanjerwin closed 10 years ago
Looks like a nice feature, but to make it simple to use the err
function type must match what is passed to the promise library, in this case to the catchError
method. Is it possible to guarantee this? Otherwise you need to partially apply the err
function, which could be as complicated as failing the test manually. What do you think?
In any case, there needs to be a way to fail a test properly. That'll be a next version feature. :)
I'm looking at promhx, which takes a Dynamic, so it seems simple to me. :)
Sure, but I'd like a bit more generically applicable features.
@brendanjerwin Good news! This is now implemented (0.13.0), but it will use a method called fail
on the BuddySuite
, so it can be used even if the function(done)
isn't specified.
Check out https://github.com/ciscoheat/buddy#failing-tests for some documentation. Thanks for another useful request!
Awesome! Yeah, now that I see it, putting the method on BuddySuite seems obvious. :)
It'd be nice to be able to wire it right up as an error handler on promises and callbacks.
Then the test would fail with a nice error message when the error callback is called.
Something like this: