Revision 9e29b6dad21ab796dbf67d6886c198f3be7a29a0 authored by olsonpm on 13 May 2017, 04:54:01 UTC, committed by Alex Lam S.L on 13 May 2017, 04:54:01 UTC
1 parent c391576
mocha.js
var Mocha = require('mocha'),
fs = require('fs'),
path = require('path');
// Instantiate a Mocha instance.
var mocha = new Mocha({});
var testDir = __dirname + '/mocha/';
// Add each .js file to the mocha instance
fs.readdirSync(testDir).filter(function(file){
// Only keep the .js files
return file.substr(-3) === '.js';
}).forEach(function(file){
mocha.addFile(
path.join(testDir, file)
);
});
module.exports = function() {
mocha.run(function(failures) {
if (failures !== 0) {
process.on('exit', function () {
process.exit(failures);
});
}
});
};
Computing file changes ...