@@ -1133,15 +1133,15 @@ await expect.element(getByTestId('button')).toMatchScreenshot('fancy-button')
11331133
11341134// with options
11351135await expect.element(getByTestId('button')).toMatchScreenshot({
1136- comparatorName: 'pixelmatch ',
1136+ comparatorName: '@blazediff/core ',
11371137 comparatorOptions: {
11381138 allowedMismatchedPixelRatio: 0.01,
11391139 },
11401140})
11411141
11421142// with both name and options
11431143await expect.element(getByTestId('button')).toMatchScreenshot('fancy-button', {
1144- comparatorName: 'pixelmatch ',
1144+ comparatorName: '@blazediff/core ',
11451145 comparatorOptions: {
11461146 allowedMismatchedPixelRatio: 0.01,
11471147 },
@@ -1150,12 +1150,13 @@ await expect.element(getByTestId('button')).toMatchScreenshot('fancy-button', {
11501150
11511151### Options
11521152
1153- - ` comparatorName: "pixelmatch" = "pixelmatch " `
1153+ - ` comparatorName: "@blazediff/core" | " pixelmatch" = "@blazediff/core " `
11541154
1155- The name of the algorithm /library used for comparing images .
1155+ The algorithm /library used for comparing images .
11561156
1157- Currently , [` "pixelmatch" ` ](https : // github.com/mapbox/pixelmatch) is the only
1158- supported comparator .
1157+ [` "@blazediff/core" ` ](https : // blazediff.dev/docs/core) is the only built-in comparator, but you can use custom ones by [registering them in the config file](/config/browser#browser-expect-toMatchScreenshot-comparators).
1158+
1159+ Since v4 .1 , ` "pixelmatch" ` is a legacy alias for ` "@blazediff/core" ` and will be removed in the next major version.
11591160
11601161- ` comparatorOptions: object `
11611162
@@ -1164,7 +1165,7 @@ await expect.element(getByTestId('button')).toMatchScreenshot('fancy-button', {
11641165
11651166 Vitest has set default values out of the box , but they can be overridden.
11661167
1167- - [` "pixelmatch " ` options ](#pixelmatch -comparator -options )
1168+ - [` "@blazediff/core " ` options ](#blazediff - core -comparator -options )
11681169
11691170 ::: warning
11701171 **Always explicitly set ` comparatorName ` to get proper type inference for
@@ -1181,9 +1182,9 @@ await expect.element(getByTestId('button')).toMatchScreenshot('fancy-button', {
11811182 },
11821183 })
11831184
1184- // ✅ TypeScript knows these are pixelmatch options
1185+ // ✅ TypeScript knows these are ` " @blazediff/core " ` options
11851186 await expect.element(button).toMatchScreenshot({
1186- comparatorName: 'pixelmatch ',
1187+ comparatorName: '@blazediff/core ',
11871188 comparatorOptions: {
11881189 allowedMismatchedPixelRatio: 0.01,
11891190 },
@@ -1208,9 +1209,9 @@ await expect.element(getByTestId('button')).toMatchScreenshot('fancy-button', {
12081209 Setting this value to ` 0 ` disables the timeout , but if a stable screenshot
12091210 can ' t be determined the process will not end.
12101211
1211- #### ` "pixelmatch " ` comparator options
1212+ #### ` "@blazediff/core " ` comparator options
12121213
1213- The following options are available when using the ` "pixelmatch " ` comparator :
1214+ The following options are available when using the ` "@blazediff/core " ` comparator :
12141215
12151216- ` allowedMismatchedPixelRatio: number | undefined = undefined `
12161217
0 commit comments