There might be a better way, but I just did this by declaring a BaseTest class that contains an array of test objects.
Example:
baseFieldViewTests: [{
name: "Test input widget()",
runTest: function () {
var inputWidget = this.field.getInputWidget();
doh.assertTrue(inputWidget.get, "Input widget has no get method");
doh.assertTrue(inputWidget.set, "Input widget has no set method");
doh.assertTrue(inputWidget.placeAt, "Input widget has no placeAt method");
}
},
Then in the subclass test I iterate through the base class tests and register them:
/**
* Register base field view tests
*/
baseFieldViewTests = new BaseFieldViewTest().baseFieldViewTests;
for (test in baseFieldViewTests) {
if (baseFieldViewTests[test]) {
doh.register("component/form/text/ReadOnlyTextViewTest",
{
name: baseFieldViewTests[test].name,
setUp: setUp,
runTest: baseFieldViewTests[test].runTest,
tearDown: tearDown
});
}
}
Not too elegant but it seems to work.