fix(logging): handle mid-line streaming output in test logger and add streaming tests

This commit is contained in:
2026-01-19 20:32:56 +00:00
parent 286030a08d
commit 9ec2c8b6eb
5 changed files with 61 additions and 9 deletions

View File

@@ -0,0 +1,12 @@
import { tap, expect } from '../../ts_tapbundle/index.js';
tap.test('check for gaps in streaming', async () => {
// This should print "ABCD" with no gaps
process.stdout.write("A");
process.stdout.write("B");
process.stdout.write("C");
process.stdout.write("D\n");
expect(true).toEqual(true);
});
export default tap.start();

View File

@@ -0,0 +1,14 @@
import { tap, expect } from '../../ts_tapbundle/index.js';
tap.test('streaming with delays', async (tools) => {
// Simulate real streaming with delays
process.stdout.write("Progress: [");
for (let i = 0; i < 10; i++) {
await tools.delayFor(50);
process.stdout.write("=");
}
process.stdout.write("]\n");
expect(true).toEqual(true);
});
export default tap.start();