2021-04-20 01:27:36 -04:00
|
|
|
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
2021-05-18 11:24:01 -04:00
|
|
|
|
2021-01-27 09:06:18 -05:00
|
|
|
window.add_result_callback(({ message, name, stack, status }) => {
|
2021-05-18 11:24:01 -04:00
|
|
|
const data = new TextEncoder().encode(
|
|
|
|
`${JSON.stringify({ name, status, message, stack })}\n`,
|
2021-01-27 09:06:18 -05:00
|
|
|
);
|
2021-05-18 11:24:01 -04:00
|
|
|
let bytesWritten = 0;
|
|
|
|
while (bytesWritten < data.byteLength) {
|
|
|
|
bytesWritten += Deno.stderr.writeSync(data.subarray(bytesWritten));
|
|
|
|
}
|
2021-01-27 09:06:18 -05:00
|
|
|
});
|
|
|
|
|
2021-06-06 12:08:50 -04:00
|
|
|
window.add_completion_callback((_tests, harnessStatus) => {
|
|
|
|
const data = new TextEncoder().encode(
|
|
|
|
`#$#$#${JSON.stringify(harnessStatus)}\n`,
|
|
|
|
);
|
|
|
|
let bytesWritten = 0;
|
|
|
|
while (bytesWritten < data.byteLength) {
|
|
|
|
bytesWritten += Deno.stderr.writeSync(data.subarray(bytesWritten));
|
|
|
|
}
|
2021-01-27 09:06:18 -05:00
|
|
|
Deno.exit(0);
|
|
|
|
});
|