Closed ltpquang closed 5 years ago
This is a good suggestion! Feel free to take a stab at it if you want. I think best would be to add a flag e.g. -clean
or so, rather than cleaning all by default. The reason being that if cleaning would be the default the following would wipe fixtures for other test cases unintentionally; go test -update -run SomeTest ./...
Hi @sebdah, I've opened PR #23, please take a look.
The idea is initialize a timestamp every time we run go test
, and then use it as directories' signature, for clean them if required by -clean
flag.
This was released just now in version v2.2.0. Thank you @ltpquang for the submitted PR :heart:
Should we clean the output directory before running
go test -update
? Since every time I update the test cases that changes the test cases' names, the old goldie files stay untouch, and I need to delete the files manually to keep the dir clean and clear.