mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
raise threshold for image snapshots using storyshots
This commit is contained in:
parent
5e1e9b9357
commit
3464004f23
@ -23,6 +23,10 @@ if (!fs.existsSync(pathToStorybookStatic)) {
|
|||||||
configPath: path.join(__dirname, '..'),
|
configPath: path.join(__dirname, '..'),
|
||||||
test: imageSnapshot({
|
test: imageSnapshot({
|
||||||
storybookUrl: `file://${pathToStorybookStatic}`,
|
storybookUrl: `file://${pathToStorybookStatic}`,
|
||||||
|
getMatchOptions: () => ({
|
||||||
|
failureThreshold: 0.01, // 1% threshold,
|
||||||
|
failureThresholdType: 'percent',
|
||||||
|
}),
|
||||||
beforeScreenshot: (page, { context }) => {
|
beforeScreenshot: (page, { context }) => {
|
||||||
// Screenshots for this story have to be tweaked.
|
// Screenshots for this story have to be tweaked.
|
||||||
if (context.kind === 'ui/Layout') {
|
if (context.kind === 'ui/Layout') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user