-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use hspec-golden-aeson for automatic golden tests #102
Conversation
694a233
to
a0c9ea4
Compare
@Anviking what do you think of having somewhere (wiki, module documentation comment or README, or an actual executable) the steps required to generate new golden tests files? |
@KtorZ I added a comment to the |
44b1e97
to
158ecae
Compare
It will also at least contains the comparison with the swagger spec. I'll push that by the end of the day 👍 |
roundtripAndGolden $ Proxy @ (ApiT WalletName) | ||
roundtripAndGolden $ Proxy @ WalletBalance | ||
roundtripAndGolden $ Proxy @ WalletPassphraseInfo | ||
roundtripAndGolden $ Proxy @ WalletState |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! It does roundtrip and golden. Perfect, then never mind my previous remark!
158ecae
to
5eba6e4
Compare
I would have hoped that the number of samples was calculated dynamically to cover all cases of complex ADTs, but that does not seem to be the case from testing in - 1634ff6. We could adjust the overall |
- Replace existing roundtrips - Replace existing golden test
5eba6e4
to
b995e49
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work 👍
Issue Number
#91
Overview
hspec-golden-aeson
as a dependency to our unit testsroundtripAndGoldenSpecsWithSettings
Comments
Split into two commits
If the JSON format of
WalletBalance
fails to matchWalletBalance.json
, the library will fail and outputWalletBalance.faulty.json
with the new format. Not sure if/what we should document about this.The output of roundtrip failures is not the same. 1) is the new and 2) is the old below:
Example output: