| Index: lib/unittest/future_matchers.dart
|
| diff --git a/lib/unittest/future_matchers.dart b/lib/unittest/future_matchers.dart
|
| index 1f3a5744e456c898a87a8c76ad0cd6f668c860a3..e95e1b1ad9fdda5df4950f33542291bb83e58142 100644
|
| --- a/lib/unittest/future_matchers.dart
|
| +++ b/lib/unittest/future_matchers.dart
|
| @@ -33,8 +33,15 @@ class _Completes extends BaseMatcher {
|
| if (item is! Future) return false;
|
|
|
| item.onComplete(expectAsync1((future) {
|
| - expect(future.hasValue,
|
| - reason: 'Expected future to complete successfully, but it failed');
|
| + var reason = 'Expected future to complete successfully, but it failed '
|
| + 'with ${future.exception}';
|
| + if (future.stackTrace != null) {
|
| + var stackTrace = future.stackTrace.toString();
|
| + stackTrace = ' ${stackTrace.replaceAll('\n', '\n ')}';
|
| + reason = '$reason\nStack trace:\n$stackTrace';
|
| + }
|
| +
|
| + expect(future.hasValue, reason: reason);
|
| if (_matcher != null) expect(future.value, _matcher);
|
| }));
|
|
|
|
|