You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find it too easy to mess up with the default configuration of creating missing golden files. Either by forgetting to commit the file, or by running the testsuite from the wrong working directory (which is easy in a multi-package project, and using cabal run library-test) and not noticing that it only passes because it did not find the golden files. Or worse: forgetting to set --no-create in CI.
I feel it would work better for me if I could configure tasty-golden such that a missing golden file were considered an error, unless a flag is passed to create the file. I had hoped that setting --no-create permanently (in my use case, via tasty-discover) would enable this, but afaict I cannot then override it on the rare occasion that I add a new golden test.
On the other hand, maybe I am missing something, and a better question may be "why do we default to creating missing golden files?"
The text was updated successfully, but these errors were encountered:
It would be possible to make --no-create the default if the NoCreateFile option would be exported (just opened #52 to do that), namely by wrapping the golden TestTree with
localOption (NoCreateFileTrue)
Then --no-create-file still can't be used to reenable creation of files, but it can be changed in code selectively.
I find it too easy to mess up with the default configuration of creating missing golden files. Either by forgetting to commit the file, or by running the testsuite from the wrong working directory (which is easy in a multi-package project, and using
cabal run library-test
) and not noticing that it only passes because it did not find the golden files. Or worse: forgetting to set--no-create
in CI.I feel it would work better for me if I could configure
tasty-golden
such that a missing golden file were considered an error, unless a flag is passed to create the file. I had hoped that setting--no-create
permanently (in my use case, viatasty-discover
) would enable this, but afaict I cannot then override it on the rare occasion that I add a new golden test.On the other hand, maybe I am missing something, and a better question may be "why do we default to creating missing golden files?"
The text was updated successfully, but these errors were encountered: