node/test/fixtures/test-runner/output/arbitrary-output.js
Moshe Atlow 7116bc08d7
test_runner: use v8.serialize instead of TAP
PR-URL: https://github.com/nodejs/node/pull/47867
Fixes: https://github.com/nodejs/node/issues/44656
Fixes: https://github.com/nodejs/node/issues/47955
Fixes: https://github.com/nodejs/node/issues/47481
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2023-05-15 14:27:45 +00:00

20 lines
659 B
JavaScript

// Flags: --test --expose-internals
'use strict';
const v8_reporter = require('internal/test_runner/reporter/v8-serializer');
const { Buffer } = require('buffer');
(async function () {
const reported = v8_reporter([
{ type: "test:pass", data: { name: "test", nesting: 0, file: __filename, testNumber: 1, details: { duration_ms: 0 } } }
]);
for await (const chunk of reported) {
process.stdout.write(chunk);
process.stdout.write(Buffer.concat([Buffer.from("arbitrary - pre"), chunk]));
process.stdout.write(Buffer.from("arbitrary - mid"));
process.stdout.write(Buffer.concat([chunk, Buffer.from("arbitrary - post")]));
}
})();