Skip to content

Instantly share code, notes, and snippets.

@bentomas
Created October 4, 2010 16:27
Show Gist options
  • Select an option

  • Save bentomas/609998 to your computer and use it in GitHub Desktop.

Select an option

Save bentomas/609998 to your computer and use it in GitHub Desktop.
module.exports = {
'asynchronousTest': function(test) {
setTimeout(function() {
// make an assertion (these are just regular assertions)
test.ok(true);
// finish the test
test.finish();
},500);
},
'synchronousTest': function(test) {
test.ok(true);
test.finish();
},
'test assertions expected': function(test) {
test.numAssertions = 1;
test.ok(true);
test.finish();
},
'test catch async error': function(test) {
var e = new Error();
test.uncaughtExceptionHandler = function(err) {
test.equal(e, err);
test.finish();
}
setTimeout(function() {
throw e;
}, 500);
}
};
// if this module is the script being run, then run the tests:
if (module == require.main) {
require('async_testing').run(__filename, process.ARGV);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment