File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -177,8 +177,9 @@ void main() {
177
177
List <({String file, String breakpointMarker, Breakpoint ? bp})>
178
178
breakpoints,
179
179
) async {
180
- final waitForPausePost = stream.firstWhere (
181
- (event) => event.kind == EventKind .kPausePostRequest,
180
+ final waitForPausePost = expectLater (
181
+ stream,
182
+ emitsThrough (_hasKind (EventKind .kPausePostRequest)),
182
183
);
183
184
184
185
// Initiate the hot reload by loading the sources into the page.
@@ -235,8 +236,8 @@ void main() {
235
236
});
236
237
}
237
238
238
- Future <Event > waitForBreakpoint () =>
239
- stream. firstWhere ((event) => event.kind == EventKind .kPauseBreakpoint);
239
+ Future <dynamic > waitForBreakpoint () =>
240
+ expectLater ( stream, emitsThrough ( _hasKind ( EventKind .kPauseBreakpoint)) );
240
241
241
242
test ('after edit and hot reload, breakpoint is in new file' , () async {
242
243
final oldString = 'main gen0' ;
@@ -501,3 +502,6 @@ void main() {
501
502
});
502
503
}, timeout: Timeout .factor (2 ));
503
504
}
505
+
506
+ TypeMatcher <Event > _hasKind (String kind) =>
507
+ isA <Event >().having ((e) => e.kind, 'kind' , kind);
You can’t perform that action at this time.
0 commit comments