node/test/fixtures/test-runner/output/arbitrary-output.js
Antoine du Hamel ad07869602
tools: enable linter in test/fixtures/test-runner/output
PR-URL: https://github.com/nodejs/node/pull/57698
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
2025-04-04 10:44:21 +02:00

23 lines
741 B
JavaScript

// Flags: --test --expose-internals
'use strict';
const v8_reporter = require('internal/test_runner/reporter/v8-serializer');
const { Buffer } = require('buffer');
// eslint-disable-next-line node-core/async-iife-no-unused-result
(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')]));
}
})();