chore(testrunner): nicer colors for test reporter (#3921)

This commit is contained in:
Andrey Lushnikov 2019-02-05 19:02:29 -08:00 committed by GitHub
parent 1676f9927c
commit bc71e9236d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -116,7 +116,7 @@ class Reporter {
console.log('\nSkipped:'); console.log('\nSkipped:');
for (let i = 0; i < skippedTests.length; ++i) { for (let i = 0; i < skippedTests.length; ++i) {
const test = skippedTests[i]; const test = skippedTests[i];
console.log(`${i + 1}) ${test.fullName} (${YELLOW_COLOR}${formatTestLocation(test)}${RESET_COLOR})`); console.log(`${i + 1}) ${test.fullName} (${formatTestLocation(test)})`);
console.log(` ${YELLOW_COLOR}Temporary disabled with xit${RESET_COLOR}`); console.log(` ${YELLOW_COLOR}Temporary disabled with xit${RESET_COLOR}`);
} }
} }
@ -131,7 +131,7 @@ class Reporter {
for (let i = 0; i < slowTests.length; ++i) { for (let i = 0; i < slowTests.length; ++i) {
const test = slowTests[i]; const test = slowTests[i];
const duration = test.endTimestamp - test.startTimestamp; const duration = test.endTimestamp - test.startTimestamp;
console.log(` (${i + 1}) ${YELLOW_COLOR}${duration / 1000}s${RESET_COLOR} - ${test.fullName} (${YELLOW_COLOR}${formatTestLocation(test)}${RESET_COLOR})`); console.log(` (${i + 1}) ${YELLOW_COLOR}${duration / 1000}s${RESET_COLOR} - ${test.fullName} (${formatTestLocation(test)})`);
} }
} }
@ -183,7 +183,7 @@ function formatTestLocation(test) {
const location = test.location; const location = test.location;
if (!location) if (!location)
return ''; return '';
return `${location.fileName}:${location.lineNumber}:${location.columnNumber}`; return `${YELLOW_COLOR}${location.fileName}:${location.lineNumber}:${location.columnNumber}${RESET_COLOR}`;
} }
module.exports = Reporter; module.exports = Reporter;