jest-image-snapshot icon indicating copy to clipboard operation
jest-image-snapshot copied to clipboard

Output interactive diff

Open anescobar1991 opened this issue 6 years ago • 10 comments

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

anescobar1991 avatar Feb 25 '18 22:02 anescobar1991

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?

metaskills avatar Jun 26 '18 14:06 metaskills

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

anescobar1991 avatar Jun 27 '18 07:06 anescobar1991

@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

kandros avatar Jan 09 '19 10:01 kandros

Love it, I subscribed to your linked issue too.

metaskills avatar Jan 09 '19 12:01 metaskills

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?

kandros avatar Jan 09 '19 13:01 kandros

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!

anescobar1991 avatar Jan 10 '19 03:01 anescobar1991

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!

tobiaslins avatar Mar 24 '19 19:03 tobiaslins

@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 :)

thomasbertet avatar Aug 27 '19 08:08 thomasbertet

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

github-actions[bot] avatar Apr 16 '20 00:04 github-actions[bot]

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

  • embed image diff in html report (i'm using https://www.npmjs.com/package/jest-html-reporter , but i can change)
  • embed image diff in atlassian bamboo test result (if possible)

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

thanks.

andreabisello avatar May 28 '20 13:05 andreabisello