I'm currently learning AngularJS and part of that covers creating tests. At the moment I'm trying to work out how to create more useful error messages for failing tests. For example, if I was in Java-land and writing JUnit tests I would do something akin to this:
assertTrue( "The foo value should be true at this point", bar.isFoo() );
That way, I'll get that first parameter in the log if the check fails.
For boolean checks in mocha (with chai and sinon, in case that makes a difference) I have...
expect(broadcastSpy.calledWith('order.add')).to.be.true;
If that fails then I get the following:
expected false to be true
AssertionError: expected false to be true
Is there a way to replicate that helpful failure message while testing my app?