Truffle allows either one or the other. Now I wonder which I shall use to test my code. I'm not a big fan of mocha. When I see code like
contract('MetaCoin', function(accounts) { it("should put 10000 MetaCoin in the first account", function() {
return MetaCoin.deployed().then(function(instance) {
return instance.getBalance.call(accounts[0]);
}).then(function(balance) {
assert.equal(balance.valueOf(), 10000, "10000 wasn't in the first account");
});
I think that something went really wrong in terms of readability. On the other hand the idea to write a contract to test another contract makes me pretty unconfortable. Which are the caveats of unit testing with these two different approaches?