fix(logging): handle mid-line streaming output in test logger and add streaming tests
This commit is contained in:
12
test/tstest/test.gap-debug.ts
Normal file
12
test/tstest/test.gap-debug.ts
Normal 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();
|
||||
14
test/tstest/test.gap-debug2.ts
Normal file
14
test/tstest/test.gap-debug2.ts
Normal 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();
|
||||
Reference in New Issue
Block a user