summaryrefslogtreecommitdiff
path: root/tools/wpt/testharnessreport.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/wpt/testharnessreport.js')
-rw-r--r--tools/wpt/testharnessreport.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/wpt/testharnessreport.js b/tools/wpt/testharnessreport.js
index 8cff0752c..d3e783376 100644
--- a/tools/wpt/testharnessreport.js
+++ b/tools/wpt/testharnessreport.js
@@ -1,13 +1,15 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+
window.add_result_callback(({ message, name, stack, status }) => {
- Deno.writeAllSync(
- Deno.stderr,
- new TextEncoder().encode(
- `${JSON.stringify({ name, status, message, stack })}\n`,
- ),
+ const data = new TextEncoder().encode(
+ `${JSON.stringify({ name, status, message, stack })}\n`,
);
+ let bytesWritten = 0;
+ while (bytesWritten < data.byteLength) {
+ bytesWritten += Deno.stderr.writeSync(data.subarray(bytesWritten));
+ }
});
-window.add_completion_callback((tests, harnessStatus) => {
+window.add_completion_callback((_tests, _harnessStatus) => {
Deno.exit(0);
});