mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
allow plugins to specify frontend test specs
This commit is contained in:
parent
9c0f881811
commit
594d272334
1 changed files with 12 additions and 1 deletions
|
@ -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/');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue