|
|
|
Ask HN: Best libraries for converting JavaScript comments to both docs and tests?
|
|
3 points
by tfb
3976 days ago
|
|
Basically, I'd like to automate docs and tests as much as possible from comments like this (or something similar): /**
* Adds `b` to `a`.
*
* @param a {Number}
* @param b {Number}
* @return {Number}
* @api public
*/
function add (a, b) {
return a + b;
}
Obviously there are libraries that can do what I'm asking, but I'm having trouble finding the best one(s), so I figured I'd just ask here. :) |
|
Now what you might want is something like:
Then the documentation could link out to the specific test or tests for this method. Though if you are going to go this route you will probably want some sort of automated code analysis to find the test locations and link them in. Creating rudimentary documentation from these comments should be trivial.