var ensure = require('ensure') , assert = require('assert') , tests = exports ; tests.foo = function (callback) { callback(true); }; tests.foo_ok = function (t) { assert.ok(t); }; ensure('foo', tests, module);
run it:
node foo.js
an extra parameter is available to allow you to define only some tests from a specific file. you can do this by providing a comma separated list of tests you want to run, e.g. ensure('foo',tests,module,'foo,bar');. you can use this in combination with process.argv to choose what tests to run from the shell: