fix(tstest): preserve streaming console output and correctly buffer incomplete TAP lines
This commit is contained in:
@@ -10,7 +10,7 @@ export class TapTestResult {
|
||||
constructor(public id: number) {}
|
||||
|
||||
/**
|
||||
* adds a logLine to the log buffer of the test
|
||||
* adds a logLine to the log buffer of the test (with newline appended)
|
||||
* @param logLine
|
||||
*/
|
||||
addLogLine(logLine: string) {
|
||||
@@ -19,6 +19,15 @@ export class TapTestResult {
|
||||
this.testLogBuffer = Buffer.concat([this.testLogBuffer, logLineBuffer]);
|
||||
}
|
||||
|
||||
/**
|
||||
* adds raw text to the log buffer without appending newline (for streaming output)
|
||||
* @param text
|
||||
*/
|
||||
addLogLineRaw(text: string) {
|
||||
const logLineBuffer = Buffer.from(text);
|
||||
this.testLogBuffer = Buffer.concat([this.testLogBuffer, logLineBuffer]);
|
||||
}
|
||||
|
||||
setTestResult(testOkArg: boolean) {
|
||||
this.testOk = testOkArg;
|
||||
this.testSettled = true;
|
||||
|
||||
Reference in New Issue
Block a user