'Golden tests' are tests that deliberately save expected output to a file, to make them easy to examine or regenerate.
https://ro-che.info/articles/2017-12-04-golden-tests
I'm familiar with the concept, but it's nice to see a handy label for it.
Related Posts
I'm experimenting with live-evaluating tests in my programming language project.
It's relatively fiddly to hook up a UI for this, but it saves a precious keystroke to run the tests! I'm hoping that it results in more, better tests due to the convenience.
Has anyone built a great solution to 'run all my unit tests automatically'?
It's straightforward to write a while loop in bash, but handling timeouts, syntax errors etc well is hard.
Running on save would be good, although I wonder if you could run fast tests on each keystroke.
I frequently find myself running:
$ slowish
$ slowish | jq
$ slowish | jq | grep
I feel there must be a better way to build up pipelines incrementally without re-running.
I could save each output to a file, but it's more verbose, and most of these tools have nicer output when stdout is a TTY.