mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-23 09:26:51 -05:00
improve test report log
This commit is contained in:
parent
92080ff49b
commit
b5326f8e49
2 changed files with 7 additions and 5 deletions
|
@ -54,7 +54,9 @@ afterAll(async () => {
|
||||||
const build = await capturesBuild;
|
const build = await capturesBuild;
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
logReport(dev) + '\n'
|
'Examples ran against previous release and current version\n\n'
|
||||||
|
+ logReport(build, `release`) + '\n'
|
||||||
|
+ logReport(dev, `current`) + '\n'
|
||||||
+ comparisonReport(dev, build, MatterBuild.version, saveComparison)
|
+ comparisonReport(dev, build, MatterBuild.version, saveComparison)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
@ -202,7 +202,7 @@ const equals = (a, b) => {
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const logReport = captures => {
|
const logReport = (captures, version) => {
|
||||||
let report = '';
|
let report = '';
|
||||||
|
|
||||||
for (const capture of Object.values(captures)) {
|
for (const capture of Object.values(captures)) {
|
||||||
|
@ -217,8 +217,8 @@ const logReport = captures => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return report ? `Output logs on last run\n\n${report}`
|
return `Output logs from ${color(version, colors.Yellow)} version on last run\n\n`
|
||||||
: 'Output logs on last run\n\n None\n';
|
+ (report ? report : ' None\n');
|
||||||
};
|
};
|
||||||
|
|
||||||
const comparisonReport = (capturesDev, capturesBuild, buildVersion, save) => {
|
const comparisonReport = (capturesDev, capturesBuild, buildVersion, save) => {
|
||||||
|
@ -271,7 +271,7 @@ const comparisonReport = (capturesDev, capturesBuild, buildVersion, save) => {
|
||||||
|
|
||||||
const report = (breakEvery, format) => [
|
const report = (breakEvery, format) => [
|
||||||
[`Output comparison of ${similarityEntries.length}`,
|
[`Output comparison of ${similarityEntries.length}`,
|
||||||
`examples against ${format('matter-js@' + buildVersion, colors.Yellow)} build on last run`
|
`examples against previous release ${format('matter-js@' + buildVersion, colors.Yellow)}`
|
||||||
].join(' '),
|
].join(' '),
|
||||||
`\n\n${format('Similarity', colors.White)}`,
|
`\n\n${format('Similarity', colors.White)}`,
|
||||||
`${format(toPercent(similarityAvg), similarityAvg === 1 ? colors.Green : colors.Yellow)}%`,
|
`${format(toPercent(similarityAvg), similarityAvg === 1 ? colors.Green : colors.Yellow)}%`,
|
||||||
|
|
Loading…
Reference in a new issue