Skip to content

Commit ba7d2f1

Browse files
committed
fix: add missing forceDeviceScaleFactor option
Signed-off-by: Jakub Freisler <[email protected]>
1 parent 10376d5 commit ba7d2f1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/commands.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ declare global {
1616
imagesDir?: string;
1717
imagesPath?: string;
1818
maxDiffThreshold?: number;
19+
forceDeviceScaleFactor?: boolean;
1920
title?: string;
2021
matchAgainstPath?: string;
2122
// IDEA: to be implemented if support for files NOT from filesystem needed
@@ -77,6 +78,7 @@ export const getConfig = (options: Cypress.MatchImageOptions) => {
7778

7879
return {
7980
scaleFactor:
81+
options.forceDeviceScaleFactor === false ||
8082
Cypress.env("pluginVisualRegressionForceDeviceScaleFactor") === false
8183
? 1
8284
: 1 / window.devicePixelRatio,
@@ -131,7 +133,9 @@ Cypress.Commands.add(
131133
} = getConfig(options);
132134

133135
const currentRetryNumber = (
134-
cy as unknown as { state: (s: string) => { currentRetry: () => number } }
136+
cy as unknown as {
137+
state: (s: string) => { currentRetry: () => number };
138+
}
135139
)
136140
.state("test")
137141
.currentRetry();

0 commit comments

Comments
 (0)