https://github.com/mishoo/UglifyJS
Raw File
Tip revision: 73d77f4f642b3830f7d83bb329c9a631eb09856f authored by Alex Lam S.L on 19 March 2018, 06:53:51 UTC
v3.3.16
Tip revision: 73d77f4
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);
        });
    });
};
back to top