Reputation: 63
I need to write doc comments for my test and then generate the documentation in a HTML file. I successfully generate the documentation with typedoc but only for my class and method and not for my test. My question is: how can I write doc comments for my test?
For my test I use testcafe. I have always successfully generated the report.
/** * test license02 */ <-- this block comment is not generated
test('LICENSE-02', async t => {
...
});
I need to generate the doc comment for my test but for now only the method and class are documented.
Thanks for your help !
Upvotes: 1
Views: 629
Reputation: 766
I can see a similar question in the TypeDoc repository: https://github.com/TypeStrong/typedoc/issues/821. TypeDoc creates documentation only for TypeScript declarations, e.g. for namespaces, classes, methods, properties, functions, variables, constants. TestCafe's tests are not declarations, they are just test
function calls, so doc comments above them are ignored.
You can declare a test body as a function and apply a doc comment to it, for example:
/**
* test license02
* @category Test
* @param t TestCafe test controller
*/
async function test_license02 (t: TestController): Promise<void> {
// ...
}
test('LICENSE-02', test_license02);
Upvotes: 1