Revision 14e712ee802da2a6199653268f8519187ece2c51 authored by Alex Lam S.L on 09 May 2018, 22:16:35 UTC, committed by GitHub on 09 May 2018, 22:16:35 UTC
fixes #3127
1 parent f83adcc
mocha.js
var fs = require("fs");
var Mocha = require("mocha");
var path = require("path");
// Instantiate a Mocha instance
var mocha = new Mocha({
timeout: 5000
});
var testDir = __dirname + "/mocha/";
// Add each .js file to the Mocha instance
fs.readdirSync(testDir).filter(function(file) {
return /\.js$/.test(file);
}).forEach(function(file) {
mocha.addFile(path.join(testDir, file));
});
module.exports = function() {
mocha.run(function(failures) {
if (failures) process.on("exit", function() {
process.exit(failures);
});
});
};
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...