Truffle shows events shot by a contract when its test fail. That is really a cool feature that may be interesting even when tests successfully pass.
I personally use Events to understand better how my contract behaves while testing them. For instance:
event Test(uint testID);
​
function someFunction (address addr, uint _uint) returns (bool) {
if (a) { Test(111); return false;}
if(b)) {Test(112); return false;}
[...] }
// or
for (uint i=0; i<n; i++) {
if (a(i)) {Test(i); return false;}
}
I'm currently adding a assert.equal(1,2) at the end to have access to those events, but might be an interesting feature to have.
@HCharlanes Good feature. It'd likely need to be added via the console, i.e., truffle test --show-events, or something to that effect. Marking as enhancement and putting on the list of things to work on.
@p14n seems like that PR is in archived repository and was not merged in core. Do you have plans on submitting a new one here?
@gnidan when will this be released on the npm version of truffle?
This is in the beta, but not the full release. Closing this for issue maintenance. Thanks!