Skip to content

Commit b5326f8

Browse files
committed
improve test report log
1 parent 92080ff commit b5326f8

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

test/Examples.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ afterAll(async () => {
5454
const build = await capturesBuild;
5555

5656
console.log(
57-
logReport(dev) + '\n'
57+
'Examples ran against previous release and current version\n\n'
58+
+ logReport(build, `release`) + '\n'
59+
+ logReport(dev, `current`) + '\n'
5860
+ comparisonReport(dev, build, MatterBuild.version, saveComparison)
5961
);
6062
});

test/TestTools.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ const equals = (a, b) => {
202202
return true;
203203
};
204204

205-
const logReport = captures => {
205+
const logReport = (captures, version) => {
206206
let report = '';
207207

208208
for (const capture of Object.values(captures)) {
@@ -217,8 +217,8 @@ const logReport = captures => {
217217
}
218218
}
219219

220-
return report ? `Output logs on last run\n\n${report}`
221-
: 'Output logs on last run\n\n None\n';
220+
return `Output logs from ${color(version, colors.Yellow)} version on last run\n\n`
221+
+ (report ? report : ' None\n');
222222
};
223223

224224
const comparisonReport = (capturesDev, capturesBuild, buildVersion, save) => {
@@ -271,7 +271,7 @@ const comparisonReport = (capturesDev, capturesBuild, buildVersion, save) => {
271271

272272
const report = (breakEvery, format) => [
273273
[`Output comparison of ${similarityEntries.length}`,
274-
`examples against ${format('matter-js@' + buildVersion, colors.Yellow)} build on last run`
274+
`examples against previous release ${format('matter-js@' + buildVersion, colors.Yellow)}`
275275
].join(' '),
276276
`\n\n${format('Similarity', colors.White)}`,
277277
`${format(toPercent(similarityAvg), similarityAvg === 1 ? colors.Green : colors.Yellow)}%`,

0 commit comments

Comments
 (0)