Skip to content

Commit

Permalink
Running all tests per file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sargento committed Jan 4, 2013
1 parent a2ae25e commit c2b4f13
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions tests/runner.js
@@ -1,18 +1,26 @@
var idx = 5;
if (!tests[idx].jsonform.form) {
tests[idx].jsonform.form = ['*'];
}
tests[idx].jsonform.form.push({
type: 'actions',
items: [
{
type: 'submit',
value: 'Submit'
var $tests = $('.tests');
var idx = 0; //or enter the index like before. ex.: 5
var limit = (idx == 0 ? tests.length - 1 : idx);

for (idx; idx <= limit; idx++) {
if (!tests[idx].jsonform.form) {
tests[idx].jsonform.form = ['*'];
}
]
});
tests[idx].jsonform.onSubmit = function (errors, values) {
console.log(errors, values);
};
$("#test-id").html(tests[idx].name);
$("#testform").jsonForm(tests[idx].jsonform);
tests[idx].jsonform.form.push({
type: 'actions',
items: [
{
type: 'submit',
value: 'Submit'
}
]
});
tests[idx].jsonform.onSubmit = function (errors, values) {
console.log(errors, values);
};

$('<h1>Test "<span class="test-name"></span>"</h1>').appendTo($tests);
$('<form id="testform" class="form-vertical"></form>').appendTo($tests);
$tests.find(".test-name").last().html(tests[idx].name);
$tests.find("#testform").last().jsonForm(tests[idx].jsonform);
}

0 comments on commit c2b4f13

Please sign in to comment.