Setted up an enviroment for frontend tests, first steps

This commit is contained in:
Peter 'Pita' Martischka 2012-10-02 00:35:43 +01:00
parent 3578e36616
commit ba4ebbba3b
9 changed files with 6501 additions and 0 deletions

View file

@ -13,6 +13,7 @@
{ "name": "importexport", "hooks": { "expressCreateServer": "ep_etherpad-lite/node/hooks/express/importexport:expressCreateServer" } },
{ "name": "errorhandling", "hooks": { "expressCreateServer": "ep_etherpad-lite/node/hooks/express/errorhandling:expressCreateServer" } },
{ "name": "socketio", "hooks": { "expressCreateServer": "ep_etherpad-lite/node/hooks/express/socketio:expressCreateServer" } },
{ "name": "tests", "hooks": { "expressCreateServer": "ep_etherpad-lite/node/hooks/express/tests:expressCreateServer" } },
{ "name": "adminplugins", "hooks": {
"expressCreateServer": "ep_etherpad-lite/node/hooks/express/adminplugins:expressCreateServer",
"socketio": "ep_etherpad-lite/node/hooks/express/adminplugins:socketio" } }

View file

@ -0,0 +1,15 @@
var path = require("path");
exports.expressCreateServer = function (hook_name, args, cb) {
args.app.get('/tests/frontend/*', function (req, res) {
var subPath = req.url.substr("/tests/frontend".length);
if (subPath == ""){
subPath = "index.html"
}
var filePath = path.normalize(__dirname + "/../../../../tests/frontend/")
filePath += subPath.replace("..", "");
res.sendfile(filePath);
});
}