mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
load list of spec files from the server
This commit is contained in:
parent
cc7ddddd2f
commit
cac27c864a
3 changed files with 18 additions and 10 deletions
|
@ -1,6 +1,15 @@
|
||||||
var path = require("path");
|
var path = require("path");
|
||||||
|
var fs = require("fs");
|
||||||
|
|
||||||
exports.expressCreateServer = function (hook_name, args, cb) {
|
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) {
|
args.app.get('/tests/frontend/*', function (req, res) {
|
||||||
var subPath = req.url.substr("/tests/frontend".length);
|
var subPath = req.url.substr("/tests/frontend".length);
|
||||||
if (subPath == ""){
|
if (subPath == ""){
|
||||||
|
|
|
@ -18,15 +18,7 @@
|
||||||
<script src="lib/jquery.iframe.js"></script>
|
<script src="lib/jquery.iframe.js"></script>
|
||||||
<script src="helper.js"></script>
|
<script src="helper.js"></script>
|
||||||
|
|
||||||
<script src="specs/button_undo.js"></script>
|
<script src="specs_list.js"></script>
|
||||||
<script src="specs/button_bold.js"></script>
|
|
||||||
<script src="specs/button_italic.js"></script>
|
|
||||||
<script src="specs/keystroke_urls_become_clickable.js"></script>
|
|
||||||
<script src="specs/keystroke_delete.js"></script>
|
|
||||||
<script src="specs/font_type.js"></script>
|
|
||||||
<script src="specs/embed_value.js"></script>
|
|
||||||
<script src="specs/keystroke_urls_become_clickable.js"></script>
|
|
||||||
<script src="specs/button_indentation.js"></script>
|
|
||||||
|
|
||||||
<script src="runner.js"></script>
|
<script src="runner.js"></script>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -4,6 +4,13 @@ $(function(){
|
||||||
document.domain = document.domain; // for comet
|
document.domain = document.domain; // for comet
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var specs = specs_list.slice();
|
||||||
|
|
||||||
|
var $body = $('body')
|
||||||
|
$.each(specs, function(i, spec){
|
||||||
|
$body.append('<script src="specs/' + spec + '"></script>')
|
||||||
|
});
|
||||||
|
|
||||||
//initalize the test helper
|
//initalize the test helper
|
||||||
helper.init(function(){
|
helper.init(function(){
|
||||||
//configure and start the test framework
|
//configure and start the test framework
|
||||||
|
|
Loading…
Reference in a new issue