Test runner.
This commit is contained in:
parent
08a84df7d8
commit
02cef37128
@ -33,6 +33,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "~1.8.1",
|
||||
"glob": "~3.2.8",
|
||||
"mocha": "~1.14.0",
|
||||
"node-inspector": "~0.6.1",
|
||||
"sinon": "~1.7.3"
|
||||
@ -49,7 +50,7 @@
|
||||
"test": "tests"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node_modules/.bin/mocha --compilers coffee:coffee-script"
|
||||
"test": "node tests.js"
|
||||
},
|
||||
"license": "AGPL3"
|
||||
}
|
||||
|
38
tests.js
Normal file
38
tests.js
Normal file
@ -0,0 +1,38 @@
|
||||
var $mocha = require('mocha');
|
||||
|
||||
var $glob = require('glob');
|
||||
|
||||
require('coffee-script');
|
||||
|
||||
//====================================================================
|
||||
|
||||
var mocha = new $mocha({
|
||||
reporter: 'spec',
|
||||
});
|
||||
|
||||
var argv = process.argv;
|
||||
for (var i = 2, n = argv.length; i < n; ++i) {
|
||||
mocha.grep(new RegExp(argv[i]));
|
||||
}
|
||||
|
||||
$glob('src/**/*.spec.coffee', function (error, files) {
|
||||
if (error) {
|
||||
console.error(error) ;
|
||||
}
|
||||
|
||||
files.forEach(function (file) {
|
||||
mocha.addFile(file);
|
||||
});
|
||||
|
||||
$glob('src/**/*.spec.js', function (error, files) {
|
||||
if (error) {
|
||||
console.error(error) ;
|
||||
}
|
||||
|
||||
files.forEach(function (file) {
|
||||
mocha.addFile(file);
|
||||
});
|
||||
|
||||
mocha.run();
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user