Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/localLighthouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export const localLighthouse = async ({
localReport,
report,
emulatedFormFactor,
runtimeError: get(result, 'runtimeError.message'),
scores
};
};
Expand Down
6 changes: 5 additions & 1 deletion src/logResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ export default ({ isGitHubAction, isLocalAudit, isOrb, results }) => {
Object.values(result.scores)
];
console.log('\n');
console.log(table(tableData, tableConfig));
if (result.runtimeError) {
console.log(`Lighthouse runtime error: ${result.runtimeError}`);
} else {
console.log(table(tableData, tableConfig));
}
console.log('\n');
});

Expand Down
7 changes: 6 additions & 1 deletion src/postPrComment.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import LighthouseCheckError from './LighthouseCheckError';
import { ERROR_UNEXPECTED_RESPONSE } from './errorCodes';
import { NAME } from './constants';

const getBadge = ({ title, score }) =>
const getBadge = ({ title, score = 0 }) =>
`![](https://img.shields.io/badge/${title}-${score}-${getLighthouseScoreColor(
{
isHex: false,
Expand Down Expand Up @@ -43,6 +43,11 @@ export default async ({
});
});

// error
if (result.runtimeError) {
markdown += `**Lighthouse runtime error**: ${result.runtimeError}\n\n`;
}

// table header
markdown += `\n| Device ${!result.report ? '' : `| Report `}| URL |\n`;
markdown += `|--${!result.report ? '' : `|--`}|--|\n`;
Expand Down
5 changes: 5 additions & 0 deletions src/slackNotify.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ export default async ({
footer
})
},
...(result.runtimeError && {
color: '#f74531',
text: `*Lighthouse runtime error*: ${result.runtimeError}`,
short: true
}),
...Object.keys(result.scores).map(current => ({
color: getLighthouseScoreColor({
isHex: true,
Expand Down