Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Document environment variables in README. Closes #19
  • Loading branch information
albertov authored Aug 27, 2024
1 parent 4f204bd commit 5cb211c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@

## Arbitrary

GoldenSpecs functions write golden files if they do not exist. When they do
exist they use a seed from the golden file to create an arbitrary value of a
GoldenSpecs functions write golden files if they do not exist and the
CREATE_MISSING_GOLDEN environment is set, otherwise the test will fail to ensure
that there is really a golden file commited int the repository and the file is not
created on every run.
When they do exist they use a seed from the golden file to create an arbitrary value of a
type and check if the serialization matches the file. If it fails it means
that there has been a change in the Aeson serialization or a change in the
data type.
data type. When a breaking change in serialization is made, one can set the
RECREATE_BROKEN_GOLDEN environment variable when running the tests while developing
(ie: do no set this env var unconditionally on CI) to recreate the golden files that have
been affected.

RoundtripSpecs make sure that a type is able to be encoded to JSON, decoded
from JSON back to the original type, and equal the same value. If it fails
Expand Down

0 comments on commit 5cb211c

Please sign in to comment.