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) => {
7575
7676export const getConfig = ( options : Cypress . MatchImageOptions ) => {
7777 const imagesDir = getImagesDir ( options ) ;
78+ const maxDiffThreshold =
79+ options . maxDiffThreshold ??
80+ ( Cypress . env ( "pluginVisualRegressionMaxDiffThreshold" ) as
81+ | number
82+ | undefined ) ;
7883
7984 return {
8085 scaleFactor :
@@ -94,11 +99,7 @@ export const getConfig = (options: Cypress.MatchImageOptions) => {
9499 ( Cypress . env ( "pluginVisualRegressionImagesPath" ) as string | undefined ) ||
95100 "{spec_path}/__image_snapshots__" ,
96101 maxDiffThreshold :
97- options . maxDiffThreshold ||
98- ( Cypress . env ( "pluginVisualRegressionMaxDiffThreshold" ) as
99- | number
100- | undefined ) ||
101- 0.01 ,
102+ typeof maxDiffThreshold === "number" ? maxDiffThreshold : 0.01 ,
102103 diffConfig :
103104 options . diffConfig ||
104105 ( Cypress . env ( "pluginVisualRegressionDiffConfig" ) as
You can’t perform that action at this time.
0 commit comments