summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter 'Pita' Martischka <petermartischka@googlemail.com>2012-10-27 17:50:59 +0100
committerPeter 'Pita' Martischka <petermartischka@googlemail.com>2012-10-27 17:50:59 +0100
commitd7a65e19f4d2c57619fdc8920ad1ad3bce846ae1 (patch)
tree3c8b7cec735e33c26f2898e00754a53997fa5c33 /tests
parent9537892c6111eae6257637627b233ce54c6620e6 (diff)
downloadetherpad-lite-d7a65e19f4d2c57619fdc8920ad1ad3bce846ae1.zip
made it possible to run only certain tests
Diffstat (limited to 'tests')
-rw-r--r--tests/frontend/runner.css4
-rw-r--r--tests/frontend/runner.js16
2 files changed, 17 insertions, 3 deletions
diff --git a/tests/frontend/runner.css b/tests/frontend/runner.css
index ba5245aa..e420e370 100644
--- a/tests/frontend/runner.css
+++ b/tests/frontend/runner.css
@@ -52,10 +52,10 @@ body {
font-weight: 200;
}
-#mocha h1 a {
+/*#mocha h1 a {
text-decoration: none;
color: inherit;
-}
+}*/
#mocha h1 a:hover {
text-decoration: underline;
diff --git a/tests/frontend/runner.js b/tests/frontend/runner.js
index 0d3f3416..1abc90c1 100644
--- a/tests/frontend/runner.js
+++ b/tests/frontend/runner.js
@@ -4,9 +4,19 @@ $(function(){
document.domain = document.domain; // for comet
}
+ //http://stackoverflow.com/questions/1403888/get-url-parameter-with-jquery
+ var getURLParameter = function (name) {
+ return decodeURI(
+ (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
+ );
+ }
+
+ //get the list of specs and filter it if requested
var specs = specs_list.slice();
+
- var $body = $('body')
+ //inject spec scripts into the dom
+ var $body = $('body');
$.each(specs, function(i, spec){
$body.append('<script src="specs/' + spec + '"></script>')
});
@@ -15,6 +25,10 @@ $(function(){
helper.init(function(){
//configure and start the test framework
//mocha.suite.timeout(5000);
+ var grep = getURLParameter("grep");
+ if(grep != "null"){
+ mocha.grep(grep);
+ }
mocha.ignoreLeaks();
mocha.run();
});