A simple assert library for use with TDD frameworks
TDDAssert is a simple assertion library that can be used in browsers and in Node.js. It began once I discovered that I couldn't use Chai for in both locations for my purposes. I needed an assertion library that would work back to Internet Explorer 7 and also one that could count assertions by default. TDDAssert feels this need in a minimalist way. I've started with the bare minimum functionality and will add more as it becomes necessary (or as requested).
The assertions at this point are pretty basic. I'm happy to add more if there's a need, but I started with the ones I use the most.
// truthy valuesassertokvalue "optional message";// auto failassertfail"optional message";// boolean valuesassertisTruevalue "optional message";assertisFalsevalue "optional message";// equalityassertequalactual expected "optional message";assertnotEqualactual expected "optional message";assertstrictEqualactual expected "optional message";assertnotStrictEqualactual expected "optional message";// errorsassertthrows// code"optional expected error message" "optional failure message";assertthrows// codeOptionalErrorType "optional failure message";assertdoesNotThrow// code;// assertion countingassertreset; // reset countassertasserted; // fails if no assertions took place