The golden file name is required in the d function. Let's create a helper that users the test description to name the golden test as suggested in this issue. The helper needs to meet the following criteria:
Make the test readable:
describe "my golden suite" $
golden "hello world" $ do
let output = "MY OUTPUT"
runGolden output
golden will replace it (from hspec) and runGolden will replace defaultGolden
If there are multiple runGolden in a golden suite the last one will be taken (this could change in the future)
The golden file name is required in the
d
function. Let's create a helper that users the test description to name the golden test as suggested in this issue. The helper needs to meet the following criteria:golden
will replaceit
(from hspec) andrunGolden
will replacedefaultGolden
runGolden
in agolden
suite the last one will be taken (this could change in the future)