@@ -22,7 +22,7 @@ void main() {
22
22
await checkThat (_futureFail ()).isRejectedByAsync (
23
23
it ()..completes ().which (it ()..equals (1 )),
24
24
actual: ['a future that completes as an error' ],
25
- which: ['threw <UnimplementedError>' ],
25
+ which: ['threw <UnimplementedError> at:' , 'fake trace ' ],
26
26
);
27
27
});
28
28
test ('can be described' , () async {
@@ -59,7 +59,10 @@ void main() {
59
59
await checkThat (_futureFail ()).isRejectedByAsync (
60
60
it ()..throws <StateError >(),
61
61
actual: ['completed to error <UnimplementedError>' ],
62
- which: ['is not an StateError' ],
62
+ which: [
63
+ 'threw an exception that is not a StateError at:' ,
64
+ 'fake trace'
65
+ ],
63
66
);
64
67
});
65
68
test ('can be described' , () async {
@@ -141,7 +144,7 @@ fake trace''');
141
144
await checkThat (_countingStream (1 , errorAt: 0 )).isRejectedByAsync (
142
145
it ()..emits (),
143
146
actual: ['a stream with error <UnimplementedError: Error at 1>' ],
144
- which: ['emitted an error instead of a value' ],
147
+ which: ['emitted an error instead of a value at:' , 'fake trace ' ],
145
148
);
146
149
});
147
150
test ('can be described' , () async {
@@ -188,7 +191,7 @@ fake trace''');
188
191
await checkThat (_countingStream (1 , errorAt: 0 )).isRejectedByAsync (
189
192
it ()..emitsError <StateError >(),
190
193
actual: ['a stream with error <UnimplementedError: Error at 1>' ],
191
- which: ['emitted an error with an incorrect type, is not StateError' ],
194
+ which: ['emitted an error which is not StateError at:' , 'fake trace ' ],
192
195
);
193
196
});
194
197
test ('can be described' , () async {
@@ -529,12 +532,16 @@ fake trace''');
529
532
530
533
Future <int > _futureSuccess () => Future .microtask (() => 42 );
531
534
532
- Future <int > _futureFail () => Future .error (UnimplementedError ());
535
+ Future <int > _futureFail () =>
536
+ Future .error (UnimplementedError (), StackTrace .fromString ('fake trace' ));
533
537
534
538
StreamQueue <int > _countingStream (int count, {int ? errorAt}) => StreamQueue (
535
539
Stream .fromIterable (
536
540
Iterable <int >.generate (count, (index) {
537
- if (index == errorAt) throw UnimplementedError ('Error at $count ' );
541
+ if (index == errorAt) {
542
+ Error .throwWithStackTrace (UnimplementedError ('Error at $count ' ),
543
+ StackTrace .fromString ('fake trace' ));
544
+ }
538
545
return index;
539
546
}),
540
547
),
0 commit comments