fix(core): update

This commit is contained in:
Philipp Kunz 2020-07-11 15:52:31 +00:00
parent 4066d9b0e8
commit 984d551bd6
2 changed files with 15 additions and 3 deletions

View File

@ -20,7 +20,15 @@ export class TapCombinator {
let failGlobal = false; // determine wether tstest should fail let failGlobal = false; // determine wether tstest should fail
for (const tapParser of this.tapParserStore) { for (const tapParser of this.tapParserStore) {
if (tapParser.getErrorTests().length === 0) { if (!tapParser.expectedTests) {
failGlobal = true;
let overviewString =
logPrefixes.TsTestPrefix +
cs(` ${tapParser.fileName} ${plugins.figures.cross}`, 'red') +
` ${plugins.figures.pointer} ` +
`does not specify tests!`;
console.log(overviewString);
} else if (tapParser.getErrorTests().length === 0) {
let overviewString = let overviewString =
logPrefixes.TsTestPrefix + logPrefixes.TsTestPrefix +
cs(` ${tapParser.fileName} ${plugins.figures.tick}`, 'green') + cs(` ${tapParser.fileName} ${plugins.figures.tick}`, 'green') +
@ -28,13 +36,13 @@ export class TapCombinator {
tapParser.getTestOverviewAsString(); tapParser.getTestOverviewAsString();
console.log(overviewString); console.log(overviewString);
} else { } else {
failGlobal = true;
let overviewString = let overviewString =
logPrefixes.TsTestPrefix + logPrefixes.TsTestPrefix +
cs(` ${tapParser.fileName} ${plugins.figures.cross}`, 'red') + cs(` ${tapParser.fileName} ${plugins.figures.cross}`, 'red') +
` ${plugins.figures.pointer} ` + ` ${plugins.figures.pointer} ` +
tapParser.getTestOverviewAsString(); tapParser.getTestOverviewAsString();
console.log(overviewString); console.log(overviewString);
failGlobal = true;
} }
} }
console.log(cs(plugins.figures.hamburger.repeat(48), 'cyan')); console.log(cs(plugins.figures.hamburger.repeat(48), 'cyan'));

View File

@ -179,7 +179,11 @@ export class TapParser {
)}` )}`
); );
} }
if (this.getErrorTests().length === 0) { if (!this.expectedTests) {
console.log(cs('Error: No tests were defined. Therefore the testfile failed!', 'red'));
} else if (this.expectedTests !== this.receivedTests) {
console.log(cs('Error: The amount of received tests and expectedTests is unequal! Therefore the testfile failed', 'red'));
} else if (this.getErrorTests().length === 0) {
console.log(`${logPrefixes.TapPrefix} ${cs(`All tests are successfull!!!`, 'green')}`); console.log(`${logPrefixes.TapPrefix} ${cs(`All tests are successfull!!!`, 'green')}`);
} else { } else {
console.log( console.log(