Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
a849f36a1b | |||
30284b770c |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gitzone/tstest",
|
||||
"version": "1.0.35",
|
||||
"version": "1.0.36",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gitzone/tstest",
|
||||
"version": "1.0.35",
|
||||
"version": "1.0.36",
|
||||
"private": false,
|
||||
"description": "a test utility to run tests that match test/**/*.ts",
|
||||
"main": "dist_ts/index.js",
|
||||
|
@ -113,7 +113,7 @@ export class TapParser {
|
||||
* returns all tests that threw an error
|
||||
*/
|
||||
public getErrorTests() {
|
||||
return this.testStore.filter(tapTestArg => {
|
||||
return this.testStore.filter((tapTestArg) => {
|
||||
return !tapTestArg.testOk;
|
||||
});
|
||||
}
|
||||
@ -140,15 +140,27 @@ export class TapParser {
|
||||
* handles a tap process
|
||||
* @param childProcessArg
|
||||
*/
|
||||
async handleTapProcess(childProcessArg: ChildProcess) {
|
||||
public async handleTapProcess(childProcessArg: ChildProcess) {
|
||||
const done = plugins.smartpromise.defer();
|
||||
childProcessArg.stdout.on('data', data => {
|
||||
childProcessArg.stdout.on('data', (data) => {
|
||||
this._processLog(data);
|
||||
});
|
||||
childProcessArg.stderr.on('data', data => {
|
||||
childProcessArg.stderr.on('data', (data) => {
|
||||
this._processLog(data);
|
||||
});
|
||||
childProcessArg.on('exit', () => {
|
||||
childProcessArg.on('exit', async () => {
|
||||
await this._evaluateResult();
|
||||
done.resolve();
|
||||
});
|
||||
await done.promise;
|
||||
}
|
||||
|
||||
public async handleTapLog(tapLog: string) {
|
||||
this._processLog(tapLog);
|
||||
await this._evaluateResult();
|
||||
}
|
||||
|
||||
private async _evaluateResult() {
|
||||
this.receivedTests = this.testStore.length;
|
||||
|
||||
// check wether all tests ran
|
||||
@ -177,12 +189,5 @@ export class TapParser {
|
||||
)}`
|
||||
);
|
||||
}
|
||||
done.resolve();
|
||||
});
|
||||
await done.promise;
|
||||
}
|
||||
|
||||
public handleTapLog(tapLog: string) {
|
||||
this._processLog(tapLog);
|
||||
}
|
||||
}
|
||||
|
@ -48,6 +48,8 @@ export class TsTest {
|
||||
break;
|
||||
}
|
||||
tapCombinator.addTapParser(tapParser);
|
||||
console.log(cs(`^`.repeat(16), 'cyan'));
|
||||
console.log(''); // force new line
|
||||
}
|
||||
tapCombinator.evaluate();
|
||||
}
|
||||
@ -67,8 +69,6 @@ export class TsTest {
|
||||
`tsrun ${fileNameArg}${tsrunOptions}`
|
||||
);
|
||||
await tapParser.handleTapProcess(execResultStreaming.childProcess);
|
||||
console.log(cs(`^`.repeat(16), 'cyan'));
|
||||
console.log(''); // force new line
|
||||
return tapParser;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user