diff --git a/src/node/hooks/express/tests.js b/src/node/hooks/express/tests.js index 94cd5fb62..50fef8004 100644 --- a/src/node/hooks/express/tests.js +++ b/src/node/hooks/express/tests.js @@ -5,6 +5,17 @@ var path = require("path") exports.expressCreateServer = function (hook_name, args, cb) { args.app.get('/tests/frontend/specs_list.js', function(req, res){ fs.readdir('tests/frontend/specs', function(err, files){ + + fs.readdir('node_modules', function(err, plugins){ // installed plugins + plugins.forEach(function(plugin){ // for each one + if(fs.existsSync("node_modules/"+plugin+"/tests/frontend/specs")){ // If the folder exists + fs.readdir("node_modules/"+plugin+"/tests/frontend/specs/", function(err, pluginFiles){ + files.push(pluginFiles); + }); + } + }); + }); + if(err){ return res.send(500); } res.send("var specs_list = " + JSON.stringify(files.sort()) + ";\n"); @@ -44,4 +55,4 @@ exports.expressCreateServer = function (hook_name, args, cb) { args.app.get('/tests/frontend', function (req, res) { res.redirect('/tests/frontend/'); }); -} \ No newline at end of file +}