Is there a build-in possibility to create snapshot tests in hspec testing framework? With snapshot, I mean, that the output of a function can be compared to an expected output stored in a file.
Or is there a hackage package to enable this feature?
Is there a build-in possibility to create snapshot tests in hspec testing framework? With snapshot, I mean, that the output of a function can be compared to an expected output stored in a file.
Or is there a hackage package to enable this feature?
Copyright © 2021 Jogjafile Inc.
The hspec-golden does what you want (the feature is called “golden tests”). Quoting their Haddocks (Test.Hspec.Golden):
The main function exported from that module is
defaultGolden
. Here's an example: