tape-six 1.10.0 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -427,6 +427,7 @@ Test output can be controlled by flags. See [Supported flags](https://github.com
|
|
|
427
427
|
|
|
428
428
|
The most recent releases:
|
|
429
429
|
|
|
430
|
+
- 1.10.1 _A workaround for a Bun's bug with streams._
|
|
430
431
|
- 1.10.0 _Worker control channel stops in-flight workers, draining cleanup before a force-kill._
|
|
431
432
|
- 1.9.0 _New features: `t.plan(n)` emits a TAP-comment diagnostic on mismatch, `registerTesterMethod(name, fn)` registers tester plugins idempotently._
|
|
432
433
|
- 1.8.0 _New subpath modules: `tape-six/server` (HTTP server harness) and `tape-six/response` (response reading helpers for `Response` and `IncomingMessage`)._
|
package/package.json
CHANGED
|
@@ -38,7 +38,7 @@ export class JSONLReporter extends Reporter {
|
|
|
38
38
|
break;
|
|
39
39
|
}
|
|
40
40
|
const jsonEvent = JSON.stringify(event);
|
|
41
|
-
this.
|
|
41
|
+
this.writeOut(this.prefix ? this.prefix + jsonEvent : jsonEvent);
|
|
42
42
|
this.state?.postprocess(event, suppressStopTest);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -9,7 +9,7 @@ export class MinReporter extends Reporter {
|
|
|
9
9
|
event = this.state?.preprocess(event) || event;
|
|
10
10
|
const handler = Reporter.EVENT_MAP[event.type];
|
|
11
11
|
typeof handler == 'string' && this[handler]?.(event);
|
|
12
|
-
this.
|
|
12
|
+
this.writeOut(
|
|
13
13
|
'Test:',
|
|
14
14
|
event.test,
|
|
15
15
|
'Type:',
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import State from '../State.js';
|
|
2
2
|
import {getTimer} from '../utils/timer.js';
|
|
3
3
|
|
|
4
|
+
// Bun's native console.log to a subprocess-piped stdout drops data / stalls under
|
|
5
|
+
// load (a Bun bug — see vault note tape-six-proc-bun-summary-suppressed). On Bun the
|
|
6
|
+
// reporters write via process.stdout.write instead; Node/Deno keep console.log.
|
|
7
|
+
const isBun = typeof Bun == 'object' && !!Bun?.version;
|
|
8
|
+
|
|
4
9
|
export class Reporter {
|
|
5
10
|
constructor({failOnce = false, timer} = {}) {
|
|
6
11
|
this.failOnce = failOnce;
|
|
@@ -10,6 +15,17 @@ export class Reporter {
|
|
|
10
15
|
this.terminating = false;
|
|
11
16
|
}
|
|
12
17
|
|
|
18
|
+
// Emit one record to stdout, mirroring console.log's arguments. On Bun,
|
|
19
|
+
// console.log to a subprocess-piped stdout is lossy / stalls under load, so route
|
|
20
|
+
// through process.stdout.write there; Node/Deno keep the proven console.log path.
|
|
21
|
+
writeOut(...args) {
|
|
22
|
+
if (isBun) {
|
|
23
|
+
process.stdout.write(args.map(a => (typeof a == 'string' ? a : String(a))).join(' ') + '\n');
|
|
24
|
+
} else {
|
|
25
|
+
(this.console || console).log(...args);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
13
29
|
get signal() {
|
|
14
30
|
return this.state?.signal;
|
|
15
31
|
}
|
|
@@ -41,7 +41,7 @@ export class TapReporter extends Reporter {
|
|
|
41
41
|
} = {}) {
|
|
42
42
|
super({failOnce});
|
|
43
43
|
this.console = originalConsole || console;
|
|
44
|
-
this.write = write || (hasColors ? this.logger : this.
|
|
44
|
+
this.write = write || (hasColors ? this.logger : (...args) => this.writeOut(...args));
|
|
45
45
|
this.renumberAsserts = renumberAsserts;
|
|
46
46
|
this.useJson = useJson;
|
|
47
47
|
this.assertCounter = 0;
|