hspec / hspec-hedgehog

A library to integrate hedgehog tests into your hspec test suite.
https://hackage.haskell.org/package/hspec-hedgehog
Other
28 stars 6 forks source link

Show less context on failure #26

Closed voidus closed 4 months ago

voidus commented 1 year ago

Currently, hedgehog always shows the whole toplevel definition on failure (as far as I can tell)

in a long definition with a bunch of describes, this is a lot of stuff we probably don't care about.

I think it would be better to only show the innermost it-call. Not sure if this requires a change with hedgehog though.

sol commented 1 year ago

This is something I would love to see as well.

From what I understand, the code that extracts the definitions is here: https://github.com/hedgehogqa/haskell-hedgehog/blob/master/hedgehog/src/Hedgehog/Internal/Discovery.hs#L44

If we don't want to reimplement all of the result formatting then I guess we would need to make this configurable in hedgehog somehow.

sol commented 1 year ago

Draft PR: https://github.com/parsonsmatt/hspec-hedgehog/pull/29