summaryrefslogtreecommitdiff
path: root/src/node/hooks/express
diff options
context:
space:
mode:
authorPeter 'Pita' Martischka <petermartischka@googlemail.com>2012-10-27 17:05:26 +0100
committerPeter 'Pita' Martischka <petermartischka@googlemail.com>2012-10-27 17:05:26 +0100
commitcac27c864a394ba7a6ce0cf6bf1e3f625c6a3d49 (patch)
tree44e5b44b76de27a11c69fe8c89953b5a4e87d0e7 /src/node/hooks/express
parentcc7ddddd2f130d1ab3487c0b1713897cb339dc5d (diff)
downloadetherpad-lite-cac27c864a394ba7a6ce0cf6bf1e3f625c6a3d49.zip
load list of spec files from the server
Diffstat (limited to 'src/node/hooks/express')
-rw-r--r--src/node/hooks/express/tests.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/node/hooks/express/tests.js b/src/node/hooks/express/tests.js
index ebc6d7f8..793fcfd8 100644
--- a/src/node/hooks/express/tests.js
+++ b/src/node/hooks/express/tests.js
@@ -1,6 +1,15 @@
var path = require("path");
+var fs = require("fs");
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){
+ if(err){ return res.send(500); }
+
+ res.send("var specs_list = " + JSON.stringify(files.sort()) + ";\n");
+ });
+ });
+
args.app.get('/tests/frontend/*', function (req, res) {
var subPath = req.url.substr("/tests/frontend".length);
if (subPath == ""){
@@ -16,5 +25,5 @@ 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