I'm using js-test-driver to test my Javascript code on several browsers:
TestCase("DropDownValueReplacerTestCase", {
setUp:function() {
console.log("BEGIN: setUp");
/*:DOC += <form id="bob"></form> */
console.log("END: setUp");
},
tearDown:function() {
console.log("BEGIN: tearDown");
console.log("END: tearDown");
},
testA:function() {
console.log("Creating foo element.");
/*:DOC += <form id="bob"></form> */
var forms = document.getElementsByTagName('form');
assertNotNull(forms);
console.log("forms:" + forms.length);
assertTrue(forms.length > 0);
var bob = document.getElementById("bob");
assertNotNull(bob);
}
});
The /*:DOC += */ statement is supposed to append html to the body tag, but apparently it doesn't work for some reason.
When I replace the :DOC syntax with something more verbose, such as:
var form = document.createElement("form");
document.body.appendChild(form);
form.id = "bob";
the test works just fine.
Did they change something and not update the documentation? I checked the hello world example out of the trunk on SVN per the website's directions to test this out. There doesn't seem to be a version number or anything.