Skip to content

Commit d45f04c

Browse files
committed
Fix test Docker build output parsing logic
1 parent 5c370b5 commit d45f04c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/interceptors/docker-attachment.spec.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ async function buildAndRun(dockerFolder: string, options: {
3535
t: imageName
3636
});
3737

38-
buildStream.on('data', (output) => {
39-
const data = JSON.parse(output);
40-
if (data.stream) console.log(data.stream.replace(/\n$/, ''));
38+
buildStream.on('data', (output: Buffer) => {
39+
output.toString().split('\n').filter(line => !!line).forEach((line) => {
40+
const data = JSON.parse(line);
41+
if (data.stream) console.log(data.stream.replace(/\n$/, ''));
42+
});
4143
});
4244

4345
await waitForDockerStream(docker, buildStream);

0 commit comments

Comments
 (0)