928320524f
- bump to mocha 1.21.5 in order to remove "*" version-range on the
"debug"-dependency
- explicit use of "dot"-reporter for mocha 1.21.5, fixes failing tests
of console.log output
- fix tests running in the browser: assign variable "global" with
global "this", backport from master-branch
- sync saucelab config with master branch:
- Remove Safari 6 and 7 that are not supported by saucelabs anymore
and cause timeouts when running the saucelabs tests.
- Add Safari 8 and Safari 9
- Note: The tests fail with Safari 9 and 10 because in these versions
the "column"-property of "Error" is read-only
(see https://github.com/jquery/esprima/issues/1290)
- Firefox needs explicit platform specifier
47 lines
1009 B
JavaScript
47 lines
1009 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.reporter('dot');
|
|
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();
|
|
});
|
|
}
|