Feature: Add interpretable failures #14
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @yugui,
I hope you are well.
We have used your test module and i found it very unhandy to interpret failure messages for tests.
For example, suppose we have a Kubernetes manifest in our code in which there is an image url.
The error messages are hard to read if we have a function to override the url in specific cases with other values and the image url itself is an object or very log string.
It is really annoying to scroll an awful lot to compare
actualandexpectedin such cases.Moreover, it is really hard to see if there are just subtle changes in the url path.
Main Changes:
If you need any further infos/examples or other changes send me a message.
Example:
Changes the output of
jsonnetunit/test/std_matchers_failure_test.jsonnetfromto:
{ "verify": { "failures": [ { "testEq": { "Expected": 1, "to be": 2 } }, { "testGe": { "Expected": 1, "to be greater than or equal to": 2 } }, { "testGt": { "Expected": 1, "to be greater than": 2 } }, { "testGtEq": { "Expected": 1, "to be greater than": 1 } }, { "testLe": { "Expected": 2, "to be less than or equal to": 1 } }, { "testLt": { "Expected": 2, "to be less than": 1 } }, { "testLtEq": { "Expected": 2, "to be less than": 2 } }, { "testNe": { "expected": 1, "not to be": 1 } }, { "testThatFunction": { "Expected": 1, "to satisfy": "the function" } }, { "testThatObject": { "Expected": 1, "to satisfy": { "actual": 1, "result": false } } }, { "testThatObjectDesc": { "Expected": 1, "to satisfy": "the condition that the value is 2" } } ], "result": "Failed 11/11 test cases" } }Best Regards