This doc states the following:

If you happen to modify the public API of Angular, API golden files must be updated using...

Also this commit has the following heading:

fix: public API golden files #16414

I'm wondering what is usually referred to as "golden files". I've googled around and it seems that this phrase is commonly used.

  • lists.boost.org/boost-users/2013/04/78334.php. It's for some specific tests, where you compare the output of a test to a specific file. – Walfrat Oct 8 '17 at 10:23
  • @Walfrat, thanks for the reference! – Max Koretskyi aka Wizard Oct 8 '17 at 10:45
  • 1
    In my neck of the woods, we refer to them as "baselines". When a test changes, or an implementation changes, we have to update the baselines to be in line with the new tests or implementations. – user1118321 Oct 12 '17 at 5:05
  • @user1118321, thanks for the info – Max Koretskyi aka Wizard Oct 12 '17 at 5:31
up vote 9 down vote accepted

A "golden file" is the expected output of some test (usually automated), stored as a separate file rather than as a string literal inside the test code. So when the test is executed, it will read in the file and compare it to the output produced by the system under test.

It's not really a very common expression; I have not heard it in 15 years of professional programming, even though I have used such files many times.

In a nutshell, a golden file is a file where we store the output and that will be used by the test as the expected output. This file should be updated any time the output changes for good reason. That's that simple :) .

Once again, introducing and using golden files in our tests is pretty straightforward and easy to use.

I got this useful link.

[http://vincent.demeester.fr/posts/2017-04-22-golang-testing-golden-file/][1]

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.