metaplex-foundation / amman

A modern mandatory toolbelt to help test solana SDK libraries and apps on a locally running validator.
https://metaplex-foundation.github.io/amman/docs/
Apache License 2.0
72 stars 17 forks source link

Allow custom log message on assertSuccess and assertError #56

Closed febo closed 2 years ago

febo commented 2 years ago

Currently, both assertSuccess and assertError allows you to specify a particular regex to be present in the log of the transaction. In most cases, this is enough to provide feedback on what the assert is testing. E.g.:

There are scenarios where there is not a specific log message that you are interested, but you still would like to provide context to the assert. For example, when creating a candy machine, an assertSuccess will give you the default message 'transaction summary has no transaction error'. While the purpose of the assert was only to test whether the transaction succeeded or not, it would be useful to provide an optional log message that would replace the default one. E.g.:

This could also be used in combination with msgRxs: