e3d3eda2e1
Converts the tool chain to use babel, eslint, and webpack vs. the previous proprietary solutions. Additionally begins enforcing additional linting concerns as well as updates the code to reflect these rules. Fixes #855 Fixes #993
46 lines
984 B
JavaScript
46 lines
984 B
JavaScript
/*eslint-disable no-console */
|
|
var fs = require('fs'),
|
|
Mocha = require('mocha'),
|
|
path = require('path');
|
|
|
|
var errors = 0,
|
|
testDir = path.dirname(__dirname),
|
|
grep = process.argv[2];
|
|
|
|
var files = [ testDir + '/basic.js' ];
|
|
|
|
var files = fs.readdirSync(testDir)
|
|
.filter(function(name) { return (/.*\.js$/).test(name); })
|
|
.map(function(name) { return testDir + '/' + name; });
|
|
|
|
run('./node', function() {
|
|
run('./browser', function() {
|
|
run('./runtime', function() {
|
|
/*eslint-disable no-process-exit */
|
|
process.exit(errors);
|
|
/*eslint-enable no-process-exit */
|
|
});
|
|
});
|
|
});
|
|
|
|
|
|
function run(env, callback) {
|
|
var mocha = new Mocha();
|
|
mocha.ui('bdd');
|
|
mocha.files = files.slice();
|
|
if (grep) {
|
|
mocha.grep(grep);
|
|
}
|
|
|
|
files.forEach(function(name) {
|
|
delete require.cache[name];
|
|
});
|
|
|
|
console.log('Running env: ' + env);
|
|
require(env);
|
|
mocha.run(function(errorCount) {
|
|
errors += errorCount;
|
|
callback();
|
|
});
|
|
}
|