summaryrefslogtreecommitdiff
path: root/cli/js/tests/test_util.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/tests/test_util.ts')
-rw-r--r--cli/js/tests/test_util.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/cli/js/tests/test_util.ts b/cli/js/tests/test_util.ts
index 9b1669744..621d86bfd 100644
--- a/cli/js/tests/test_util.ts
+++ b/cli/js/tests/test_util.ts
@@ -244,7 +244,7 @@ export class SocketReporter implements Deno.TestReporter {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async write(msg: any): Promise<void> {
- const encodedMsg = this.encoder.encode(`${JSON.stringify(msg)}\n`);
+ const encodedMsg = this.encoder.encode(JSON.stringify(msg) + "\n");
await Deno.writeAll(this.conn, encodedMsg);
}
@@ -270,7 +270,9 @@ export class SocketReporter implements Deno.TestReporter {
}
async end(msg: Deno.TestEventEnd): Promise<void> {
- await this.write(msg);
+ const encodedMsg = this.encoder.encode(JSON.stringify(msg));
+ await Deno.writeAll(this.conn, encodedMsg);
+ this.conn.closeWrite();
}
}