summaryrefslogtreecommitdiff
path: root/tests/frontend/runner.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/frontend/runner.js')
-rw-r--r--tests/frontend/runner.js16
1 files changed, 15 insertions, 1 deletions
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();
});