Skip to content

Commit 0c12e21

Browse files
committed
fix: restore viewport default settings
1 parent c9e9d2e commit 0c12e21

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { screenshot } from './microlink.js'
77

88
const DEFAULT_THRESHOLD = 0.001
99
const DEFAULT_PIXEL_THRESHOLD = 0.1
10+
const DEFAULT_VIEWPORT = { width: 1280, height: 800 }
1011
const DEFAULT_ROUTES = ['/']
1112

1213
const noop = () => {}
@@ -145,7 +146,7 @@ export const run = async ({
145146
if (!Array.isArray(routes) || routes.length === 0)
146147
throw new Error('routes must be a non-empty array')
147148

148-
const mql = { apiKey, ...mqlOpts }
149+
const mql = { viewport: DEFAULT_VIEWPORT, apiKey, ...mqlOpts }
149150
const resolvedThreshold = await resolveThreshold({ flag: threshold, cwd })
150151
log(
151152
`threshold resolved: ${resolvedThreshold} (pixel-threshold: ${pixelThreshold})`

0 commit comments

Comments
 (0)