File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,11 @@ const getImagesDir = (options: Cypress.MatchImageOptions) => {
75
75
76
76
export const getConfig = ( options : Cypress . MatchImageOptions ) => {
77
77
const imagesDir = getImagesDir ( options ) ;
78
+ const maxDiffThreshold =
79
+ options . maxDiffThreshold ??
80
+ ( Cypress . env ( "pluginVisualRegressionMaxDiffThreshold" ) as
81
+ | number
82
+ | undefined ) ;
78
83
79
84
return {
80
85
scaleFactor :
@@ -94,11 +99,7 @@ export const getConfig = (options: Cypress.MatchImageOptions) => {
94
99
( Cypress . env ( "pluginVisualRegressionImagesPath" ) as string | undefined ) ||
95
100
"{spec_path}/__image_snapshots__" ,
96
101
maxDiffThreshold :
97
- options . maxDiffThreshold ||
98
- ( Cypress . env ( "pluginVisualRegressionMaxDiffThreshold" ) as
99
- | number
100
- | undefined ) ||
101
- 0.01 ,
102
+ typeof maxDiffThreshold === "number" ? maxDiffThreshold : 0.01 ,
102
103
diffConfig :
103
104
options . diffConfig ||
104
105
( Cypress . env ( "pluginVisualRegressionDiffConfig" ) as
You can’t perform that action at this time.
0 commit comments