Skip to content

Commit 4bd72c9

Browse files
committed
Readded byline as you can just wrap the stream directly
1 parent d994641 commit 4bd72c9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/testcontainers/src/wait-strategies/log-wait-strategy.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { log } from "../common";
44
import { getContainerRuntimeClient } from "../container-runtime";
55
import { BoundPorts } from "../utils/bound-ports";
66
import { AbstractWaitStrategy } from "./wait-strategy";
7+
import byline from "byline";
78

89
export type Log = string;
910

@@ -30,8 +31,8 @@ export class LogWaitStrategy extends AbstractWaitStrategy {
3031
const stream = await client.container.logs(container, { since: startTime ? startTime.getTime() / 1000 : 0 });
3132

3233
let matches = 0;
33-
for await (const chunk of stream) {
34-
if (this.matches(chunk)) {
34+
for await (const line of byline(stream)) {
35+
if (this.matches(line)) {
3536
if (++matches === this.times) {
3637
return log.debug(`Log wait strategy complete`, { containerId: container.id });
3738
}

0 commit comments

Comments
 (0)