joshua | Flow (2024-06-05)
How do I get errors in the Cadence testing framework to print so they are easily readable?
6 Replies
I've created a thread for your message. Please continue any relevant discussion in this thread.
You can rename this thread using
/title <new title>
If this is a technical question that others may benefit from, considering also asking it on Stackoverflow: https://stackoverflow.com/questions/ask?tags=onflow-cadenceWhen I run tests, I get errors like this:
all jumbled up
I haven't been able to figure out how to pretty print test errors. I typically copy paste that and replace \n with enter but it's not very efficient
it's just printing the value, which as a string in it which is the error message
ah, I guess
I.Test.Test.Error
is actually defined by the test framework
please open an issue in https://github.com/onflow/cadence-tools
for now maybe just pipe the output into something that replaces the newline literals (\n
) into newlines, e.g. | sed -e 's/\\n/\n/g'
e.g. flow-c1 test --cover --covercode="contracts" tests/*.cdc | sed -e 's/\\n/\n/g'
Thanks!
GitHub
[Cadence Testing Framework] Pretty Print Error Messages when runnin...
Issue to be solved When running tests with the Cadence testing framework, the errors are spat out as a huge wall of text. It would be great if they were printed in a way that makes them easier to r...