fix(improve test handling): now failing correctly and with better log output

This commit is contained in:
2018-08-13 23:58:50 +02:00
parent df3f1ea9d6
commit b1725b636b
6 changed files with 55 additions and 30 deletions

View File

@@ -0,0 +1,26 @@
// ============
// combines different tap test files to an overall result
// ============
import * as plugins from './tstest.plugins';
export class TapTestResult {
testLogBuffer = Buffer.from('');
testOk: boolean = false;
testSettled: boolean = false;
constructor(public id: number) {}
/**
* adds a logLine to the log buffer of the test
* @param logLine
*/
addLogLine(logLine: string) {
logLine = logLine + '\n';
const logLineBuffer = Buffer.from(logLine);
this.testLogBuffer = Buffer.concat([this.testLogBuffer, logLineBuffer]);
}
setTestResult(testOkArg: boolean) {
this.testOk = testOkArg;
this.testSettled = true;
}
}