americanexpress / jest-image-snapshot

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

Output interactive diff #51

Open anescobar1991 opened 6 years ago

anescobar1991 commented 6 years ago

Would be cool if a failing test result could output an html report with details about the failing snapshot and an interactive diff much like what bitbucket server provides

metaskills commented 6 years ago

Or alternatively, using term-img (https://github.com/sindresorhus/term-img) to show the diff in the console. Are there any hooks where I can wire this up myself?

anescobar1991 commented 6 years ago

@metaskills you may be able to create a custom Jest reporter to do so

kandros commented 5 years ago

@metaskills I'm doing experiments with it, looking good so far but had to edit jest-image-snapshot core, looking into custom reporter right now

image

also looking at wayt to add interactive review https://github.com/americanexpress/jest-image-snapshot/issues/84

metaskills commented 5 years ago

Love it, I subscribed to your linked issue too.

kandros commented 5 years ago

I need to add result to the result of the matcher https://github.com/americanexpress/jest-image-snapshot/blob/master/src/index.js#L120

but I cannot find a way to read a matcher result data from a custom reporter

looking at jest code I should be already able to read at least pass and message from a reporter https://github.com/facebook/jest/blob/master/packages/expect/src/index.js#L274

but I cannot find where this is available

@anescobar1991 do you have any idea where a custom reporter can read the result object of a custom matcher?

anescobar1991 commented 5 years ago

Oops! Got here too late I see you have figured it out in the Jest repo. This will be a great contribution though I can’t wait to see it!

tobiaslins commented 5 years ago

We are using Axcept for snapshot testing, management & diffs. @anescobar1991 can't find out if it is allowed to post this. Please remove if not!

thomasbertet commented 5 years ago

@kandros did you manage to hack something ? I might be interested to push forward the interactive mode especially, not sure its something you started doing. Please let me know :)

github-actions[bot] commented 4 years ago

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

andreabisello commented 4 years ago

i'm subriscribing this issue because i'm searching for something in order to add the imagediff on the html report as asked here https://github.com/americanexpress/jest-image-snapshot/issues/157

i would like to

someone can suggest me a simply way to obtain mainly the first bullet point?

thanks.