americanexpress / jest-image-snapshot

✨ Jest matcher for image comparisons. Most commonly used for visual regression testing.
Apache License 2.0
3.81k stars 197 forks source link

toMatchImageSnapshot & typescript [doubt] #253

Open DiegoFBenavides opened 3 years ago

DiegoFBenavides commented 3 years ago

Hi! I´m using the custom config to catch my snapshot but also I´m trying to move mi project to Typescript and I cannot solve the next problem. "Cannot assign to 'toMatchImageSnapshot' because it is not a variable." and the part of my code something like... import {toMatchImageSnapshot, configureToMatchImageSnapshot} from "jest-image-snapshot";

const customConfig = { threshold: 0.5}; toMatchImageSnapshot = configureToMatchImageSnapshot({ customDiffConfig: customConfig, noColors: true, failureThreshold: 0.01, failureThresholdType: 'percent', customSnapshotsDir: "./__image_snapshots__/"+deviceName, }); expect.extend({ toMatchImageSnapshot });

Someone has any idea to solve? THX

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity.

gaitat commented 3 years ago

remove toMatchImageSnapshot from the import