made it possible to run only certain tests

This commit is contained in:
Peter 'Pita' Martischka 2012-10-27 17:50:59 +01:00
parent 9537892c61
commit d7a65e19f4
2 changed files with 18 additions and 4 deletions

View File

@ -52,10 +52,10 @@ body {
font-weight: 200; font-weight: 200;
} }
#mocha h1 a { /*#mocha h1 a {
text-decoration: none; text-decoration: none;
color: inherit; color: inherit;
} }*/
#mocha h1 a:hover { #mocha h1 a:hover {
text-decoration: underline; text-decoration: underline;

View File

@ -4,9 +4,19 @@ $(function(){
document.domain = document.domain; // for comet 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 specs = specs_list.slice();
var $body = $('body')
//inject spec scripts into the dom
var $body = $('body');
$.each(specs, function(i, spec){ $.each(specs, function(i, spec){
$body.append('<script src="specs/' + spec + '"></script>') $body.append('<script src="specs/' + spec + '"></script>')
}); });
@ -15,6 +25,10 @@ $(function(){
helper.init(function(){ helper.init(function(){
//configure and start the test framework //configure and start the test framework
//mocha.suite.timeout(5000); //mocha.suite.timeout(5000);
var grep = getURLParameter("grep");
if(grep != "null"){
mocha.grep(grep);
}
mocha.ignoreLeaks(); mocha.ignoreLeaks();
mocha.run(); mocha.run();
}); });