My testing framework is written in CoffeeScript and fits in a Tweet.
And this is meant including examples and documentation. ;-)
This is my little framework:
1 | tests = {ok:(->true),should_have:->false};console.log( if t() then ’.’ else “\n#{d} FAILED\n”) for d,t of tests #coffescript #testing |
Just create an object where all keys are descriptions of the functions and functions have to return true or false.
The examples could be a little bit more specific though.