Example 112. testeeType and testeeMethod with omitted constraints
Assume testees similar as in testeeType and testeeMethod. Since the semantics of bar
is not changed in B
, it is probably not necessary to generate the same constraint in the documentation for bar
twice (one in the section for class A
and another one in the section of class B
).
Still, we want the test to be executed for both receivers. This is how it is achieved:
abstract class BaseTest {
abstract fixture(): A;
/**
* @testeeMember bar
*/
@Test testBar(): void { assertBehavior( fixture().bar() ); }
}
/**
* @testeeType A.A
*/
class ATest extends BaseTest {
fixture(): A { return new A(); }
}
class BTest extends BaseTest {
@Override fixture(): B { return new B(); }
}
This actually defines two tests as in the previous example. Only one
constraint is created in the spec by the spec exporter:
-
testBar
for a receiver of type A
:
ATest
's JSDoc @testeeType
+ BaseTest.testBar
's JSDoc @testeeMember
= testee A.A.bar
Although a test for receiver of type B
is run, no additional constraint is
created since there is no @testeeType
available neither in BTest
nor in BaseTest
.