Skip to content

Instantly share code, notes, and snippets.

@scalvert
Created March 12, 2014 16:37
Show Gist options
  • Save scalvert/9510889 to your computer and use it in GitHub Desktop.
Save scalvert/9510889 to your computer and use it in GitHub Desktop.
testRunner.js
require(['config'], function(){
require(['require',
'walk',
'chai',
'mocha'],
function(require, walk, chai, mocha){
var tests = [];
var walker = walk.walk('./', { followLinks: false });
walker.on('file', function(root, stat, next) {
tests.push(root + '/' + stat.name);
next();
});
walker.on('end', function() {
require(tests, function() {
assert = chai.assert;
if (window.mochaPhantomJS) {
return window.mochaPhantomJS.run();
}
mocha.run();
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment