Refactored test suite once more, as proposed by John
This commit is contained in:
parent
76188ae457
commit
826bb93cc3
5 changed files with 140 additions and 134 deletions
|
@ -20,12 +20,17 @@ var jq = parse( readFile( arguments[0] ) );
|
|||
|
||||
var testFile = [];
|
||||
|
||||
String.prototype.decode = function() {
|
||||
return this.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&");
|
||||
};
|
||||
|
||||
for ( var i = 0; i < jq.length; i++ ) {
|
||||
if ( jq[i].tests.length > 0 ) {
|
||||
var method = jq[i];
|
||||
var name = addParams(method.name, method.params);
|
||||
testFile[testFile.length] = addTestWrapper(name, method.tests.join("\n"));
|
||||
testFile[testFile.length] = addTestWrapper(name, method.tests.join("\n").decode());
|
||||
}
|
||||
}
|
||||
|
||||
writeFile( dir + "/tests.js", testFile.join("\n") );
|
||||
var indexFile = readFile( "build/test/index.html" );
|
||||
writeFile( dir + "/index.html", indexFile.replace( /{TESTS}/g, testFile.join("\n") ) );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue