Skip to content

Commit a60e3c6

Browse files
committedJul 17, 2024
fix(cli): destructure lhr from options
1 parent 82b272c commit a60e3c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎packages/cli/src/assert/assert.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ function readBudgets(budgetsFile) {
5050
* @return {Promise<void>}
5151
*/
5252
async function runCommand(options) {
53-
const {budgetsFile, assertions, assertMatrix, preset} = options;
53+
const {budgetsFile, assertions, assertMatrix, preset, lhr} = options;
5454
const areAssertionsSet = Boolean(assertions || assertMatrix || preset);
5555
if (!areAssertionsSet && !budgetsFile) throw new Error('No assertions to use');
5656
if (budgetsFile && areAssertionsSet) throw new Error('Cannot use both budgets AND assertions');
5757
// If we have a budgets file, convert it to our assertions format.
5858
if (budgetsFile) options = await convertBudgetsToAssertions(readBudgets(budgetsFile));
5959

60-
const lhrs = loadSavedLHRs(options.lhr).map(json => JSON.parse(json));
60+
const lhrs = loadSavedLHRs(lhr).map(json => JSON.parse(json));
6161
const uniqueUrls = new Set(lhrs.map(lhr => lhr.finalUrl));
6262
const allResults = getAllAssertionResults(options, lhrs);
6363
const groupedResults = _.groupBy(allResults, result => result.url);

0 commit comments

Comments
 (0)
Please sign in to comment.