@@ -22,7 +22,7 @@ void main() {
2222 await checkThat (_futureFail ()).isRejectedByAsync (
2323 it ()..completes ().which (it ()..equals (1 )),
2424 actual: ['a future that completes as an error' ],
25- which: ['threw <UnimplementedError>' ],
25+ which: ['threw <UnimplementedError> at:' , 'fake trace ' ],
2626 );
2727 });
2828 test ('can be described' , () async {
@@ -59,7 +59,10 @@ void main() {
5959 await checkThat (_futureFail ()).isRejectedByAsync (
6060 it ()..throws <StateError >(),
6161 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+ ],
6366 );
6467 });
6568 test ('can be described' , () async {
@@ -141,7 +144,7 @@ fake trace''');
141144 await checkThat (_countingStream (1 , errorAt: 0 )).isRejectedByAsync (
142145 it ()..emits (),
143146 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 ' ],
145148 );
146149 });
147150 test ('can be described' , () async {
@@ -188,7 +191,7 @@ fake trace''');
188191 await checkThat (_countingStream (1 , errorAt: 0 )).isRejectedByAsync (
189192 it ()..emitsError <StateError >(),
190193 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 ' ],
192195 );
193196 });
194197 test ('can be described' , () async {
@@ -529,12 +532,16 @@ fake trace''');
529532
530533Future <int > _futureSuccess () => Future .microtask (() => 42 );
531534
532- Future <int > _futureFail () => Future .error (UnimplementedError ());
535+ Future <int > _futureFail () =>
536+ Future .error (UnimplementedError (), StackTrace .fromString ('fake trace' ));
533537
534538StreamQueue <int > _countingStream (int count, {int ? errorAt}) => StreamQueue (
535539 Stream .fromIterable (
536540 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+ }
538545 return index;
539546 }),
540547 ),
0 commit comments