You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am writing a unit test for a public function. Inside that public function I call into a read-only function that encounters a runtime error (failed unwrap-panic), however the test runner still reports the test as OK.
Currently, a runtime error in clarity won't make the test fail.
const block = chain.mineBlock([
Tx.contractCall(
"contract",
"will-panic", // will run time error
[],
wallet_1.address
),
]); // won't throw an error
So the test has to actually check the result of the call or the block height or something like assertEquals(block.receipts.length, 1).
Does that make sense?
Also we are currently thinking about revamping clarinet test so we could definitely consider changing this behavior (so that a clarity runtime error throws an error on the JS side)
I am writing a unit test for a public function. Inside that public function I call into a read-only function that encounters a runtime error (failed
unwrap-panic
), however the test runner still reports the test as OK.Example:
clarinet test
output:The text was updated successfully, but these errors were encountered: