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 diff --git a/tests/frontend/index.html b/tests/frontend/index.html index 45c46b3a..6c3a587f 100644 --- a/tests/frontend/index.html +++ b/tests/frontend/index.html @@ -18,15 +18,7 @@ - - - - - - - - - + diff --git a/tests/frontend/runner.js b/tests/frontend/runner.js index 6e7fe1ab..0d3f3416 100644 --- a/tests/frontend/runner.js +++ b/tests/frontend/runner.js @@ -4,6 +4,13 @@ $(function(){ document.domain = document.domain; // for comet } + var specs = specs_list.slice(); + + var $body = $('body') + $.each(specs, function(i, spec){ + $body.append('') + }); + //initalize the test helper helper.init(function(){ //configure and start the test framework