diff --git a/pkgs/test/README.md b/pkgs/test/README.md index 6e174095c0d1a6a59b462c4aa568982243e783ec..1dced93f702a72f287673e39b3e17f22345eb6ff 100644 --- a/pkgs/test/README.md +++ b/pkgs/test/README.md @@ -459,14 +459,14 @@ void main() { ])); // Ignore lines from the process until it's about to emit the URL. - await expect(stdout, emitsThrough('WebSocket URL:')); + await expectLater(stdout, emitsThrough('WebSocket URL:')); // Parse the next line as a URL. var url = Uri.parse(await stdout.next); expect(url.host, equals('localhost')); // You can match against the same StreamQueue multiple times. - await expect(stdout, emits('Waiting for connection...')); + await expectLater(stdout, emits('Waiting for connection...')); }); } ``` diff --git a/pkgs/test_api/lib/src/frontend/stream_matcher.dart b/pkgs/test_api/lib/src/frontend/stream_matcher.dart index 5446e2cfe514a391299116f3f7add2405762db1f..6eade9e0aee42a337acbcd026882529bab446d15 100644 --- a/pkgs/test_api/lib/src/frontend/stream_matcher.dart +++ b/pkgs/test_api/lib/src/frontend/stream_matcher.dart @@ -48,14 +48,14 @@ typedef _MatchQueue = Future<String> Function(StreamQueue queue); /// var stdout = StreamQueue(stdoutLineStream); /// /// // Ignore lines from the process until it's about to emit the URL. -/// await expect(stdout, emitsThrough("WebSocket URL:")); +/// await expectLater(stdout, emitsThrough('WebSocket URL:')); /// /// // Parse the next line as a URL. /// var url = Uri.parse(await stdout.next); /// expect(url.host, equals('localhost')); /// /// // You can match against the same StreamQueue multiple times. -/// await expect(stdout, emits("Waiting for connection...")); +/// await expectLater(stdout, emits('Waiting for connection...')); /// ``` /// /// Users can call [new StreamMatcher] to create custom matchers.