Skip to content

Commit be94a37

Browse files
authored
feat: add overview messaging (#20)
1 parent ec329bc commit be94a37

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/index.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ const formatResults = ({ results, thresholds }) => {
7575
})),
7676
};
7777

78-
return { summary, errors };
78+
const shortSummary = categories
79+
.map(({ title, score }) => `${title}: ${score * 100}`)
80+
.join(', ');
81+
82+
return { summary, shortSummary, errors };
7983
};
8084

8185
const getConfiguration = ({ constants, inputs }) => {
@@ -134,11 +138,12 @@ module.exports = {
134138
if (error) {
135139
throw error;
136140
} else {
137-
const { summary, errors } = formatResults({ results, thresholds });
138-
console.log(summary);
139-
show({
140-
summary: JSON.stringify(summary, null, 2),
141+
const { summary, shortSummary, errors } = formatResults({
142+
results,
143+
thresholds,
141144
});
145+
console.log(summary);
146+
show({ summary: shortSummary });
142147

143148
if (errors.length > 0) {
144149
throw new Error(`\n${errors.join('\n')}`);

0 commit comments

Comments
 (0)