stackbuilders / hspec-golden

Golden tests with Hspec
MIT License
26 stars 8 forks source link

Option to not leave output in directory #13

Closed sirlensalot closed 1 year ago

sirlensalot commented 4 years ago

For many golden usecases it is not ideal to store the output in a repository alongside the golden file, which this currently does (see https://github.com/stackbuilders/hspec-golden/blob/f361111d5b5feeeda497c8eaf32dd33a00f3c823/examples/json/.otherGolden/json/actual#L1).

An option to clean up this file would be ideal.

CristhianMotoche commented 4 years ago

Hello @slpopejoy I'm sorry for the late response. I like the idea. I'll try to implement it as soon as I can. In the meantime, I think a workaround is to simply ignore these files.

This option works for git:

actual
CristhianMotoche commented 1 year ago

An easy way to get rid of the actual file is by running the test and then calling hgold:

hgold

That will generate the actual and golden file and then the CLI will move actual to golden.