testino ======= "small test" for node
"small test" for node
A small test runner for a simple, small test framework. Because, hey, everyone writes a test framework in node, right?
Really, I just wanted to see what I could do in a day or two. I'm currently using it in node-ravendb for two reasons:
Keep things small (the main testino module is around 300 lines of code) and simple, support the assert module. Other than that, a few simple things:
These points are demonstrated in the Usage section below.
var testino = require'testino';var assert = require'assert';moduleexports = sampleTester = testinocreateFixture'Sample Tester';sampleTestertests =assertoktrue 'just making sure things are wired up';assertoktrue 'see, this is easy!';var actual = expected = null;assertfailactual expected 'this test failed on purpsose';throw "This result should end up in the Other category";;// If the file is run directly, just run the test fixture with default outputif requiremain === module console.logmoduleexportsrun;
and the output is:
$ node sample-test.jsTEST RESULTS FOR Sample Tester Total: 4Passed: 2 Failed: 1 Other : 1FAILED test details:thisTestShouldFail AssertionError: this test failed on purpsoseOTHER test details:tests with unexpected errors end up in the "Other" category Error: This result should end up in the Other category
© 2013 Tony Heupel