node-suite.js 456 B

123456789101112131415161718
  1. // test/mocha/node-suite.js
  2. // This runs with mocha programmatically rather than from the command line.
  3. // how-to-with-comments taken from https://github.com/itaylor/qunit-mocha-ui
  4. //Load mocha
  5. var Mocha = require("mocha");
  6. //Tell mocha to use the interface.
  7. var mocha = new Mocha({ui:"qunit", reporter:"spec"});
  8. //Add your test files
  9. mocha.addFile("./test/mocha/suite.js");
  10. //Run your tests
  11. mocha.run(function(failures){
  12. process.exit(failures);
  13. });