Skip to content

Commit 46ebfcc

Browse files
test: fix
1 parent 744c627 commit 46ebfcc

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

test/logging.test.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ describe.each(scenarios)("logging $name", ({ args }) => {
838838
});
839839
});
840840

841-
it('should logging an error in "watch" method', (done) => {
841+
it('should logging an error in "watch" method', async () => {
842842
const proc = execa(runner, args, {
843843
stdio: "pipe",
844844
reject: false,
@@ -847,22 +847,13 @@ describe.each(scenarios)("logging $name", ({ args }) => {
847847
},
848848
});
849849

850-
let stderr = "";
851-
852-
proc.stderr.on("data", (chunk) => {
853-
stderr += chunk.toString();
850+
proc.stderr.on("data", () => {
854851
proc.stdin.write("|exit|");
855852
});
856853

857-
proc.on("error", (error) => {
858-
done(error);
859-
});
860-
861-
proc.on("exit", () => {
862-
expect(stderrToSnapshot(stderr)).toMatchSnapshot("stderr");
854+
const result = await proc;
863855

864-
done();
865-
});
856+
expect(stderrToSnapshot(result.stderr)).toMatchSnapshot("stderr");
866857
});
867858

868859
if (os.platform() !== "win32") {

0 commit comments

Comments
 (0)