Add challenge testing

This commit is contained in:
Berkeley Martinez
2015-11-01 17:20:03 -08:00
parent bde6b81b83
commit 921080f3d2
9 changed files with 194 additions and 48 deletions

19
seed/getChallenges.js Normal file
View File

@ -0,0 +1,19 @@
var fs = require('fs');
var path = require('path');
function getFilesFor(dir) {
return fs.readdirSync(path.join(__dirname, '/' + dir));
}
module.exports = function getChallenges() {
try {
return getFilesFor('challenges')
.map(function(file) {
return require('./challenges/' + file);
});
} catch (e) {
console.log('error', e);
return [];
}
};