cairo
cairo copied to clipboard
feat: export tests results as JSON
Add an --export parameter to cairo-test accepting a path to export tests results as JSON.
use :
cairo-test ./src/tests.cairo --single-file --export ./tests.json
example results for Success / Fail :
[
{
"name": "tests::tests::test_1",
"status": "Success",
"gas_usage": 500
},
{
"name": "tests::tests::test_2",
"status": "Fail",
"gas_usage": 1600,
"error_messages": [
"this is panic !!!",
"with",
"a long",
"message"
]
}
]
I don't feel able to make modifs to make it work the way @mkaput described. I could make a PR to fit @orizi requested changes (just let me know) but you maybe want to rework/implement this feature the way @mkaput suggested. Anyway it could be convenient to have a simple JSON file as export option.