Skip to content

Commit

Permalink
Prevent overriding emulated device
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Nov 26, 2024
1 parent c73d2d2 commit 484025e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cli/commands/benchmark-web-vitals.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,10 @@ async function benchmarkURL(
await page.emulate( params.emulateDevice );
}
if ( params.windowViewport ) {
await page.setViewport( params.windowViewport );
await page.setViewport( {
...( params.emulateDevice ? params.emulateDevice.viewport : {} ),

Check failure on line 476 in cli/commands/benchmark-web-vitals.mjs

View workflow job for this annotation

GitHub Actions / Lint

Replace `·?·params.emulateDevice.viewport·` with `⏎↹↹↹↹↹?·params.emulateDevice.viewport⏎↹↹↹↹↹`
...params.windowViewport

Check failure on line 477 in cli/commands/benchmark-web-vitals.mjs

View workflow job for this annotation

GitHub Actions / Lint

Insert `,`
} );
}

// Load the page.
Expand Down

0 comments on commit 484025e

Please sign in to comment.