We may want to do some actions that return a Golden test. There are some workarounds at the moment, but it will be convenient to have an IO instance for Golden. For instance we could do something like:
goldenTest :: String -> IO (Golden String)
goldenTest str = do
lookupEnv str >>= \case
Nothing -> throwIO $ AssertionFailed (str ++ " Not found")
Just s -> defaultGolden s <$> someIOAction
We may want to do some actions that return a Golden test. There are some workarounds at the moment, but it will be convenient to have an IO instance for
Golden
. For instance we could do something like:For that we need to add an Example Instance to
IO Golden