Add challenge testing

This commit is contained in:
Berkeley Martinez
2015-11-01 17:20:03 -08:00
parent dfea2ca1a9
commit 28790899af
7 changed files with 185 additions and 45 deletions

19
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 [];
}
};