summaryrefslogtreecommitdiff
path: root/cli/doc/tests.rs
diff options
context:
space:
mode:
authorMatt Dumler <mattd3v@pm.me>2020-05-27 16:38:36 -0500
committerGitHub <noreply@github.com>2020-05-27 23:38:36 +0200
commitf6e58b076ca430c29f164b65678bbf6bc64a39b7 (patch)
tree68a7102c6b7bb6643ce7aa5cc60fa143fbc420e8 /cli/doc/tests.rs
parentf8c6500eef59e046f4fd90d3c37a1e16606a0a78 (diff)
fix(doc): handle comments at the top of the file (#5891)
Diffstat (limited to 'cli/doc/tests.rs')
-rw-r--r--cli/doc/tests.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/cli/doc/tests.rs b/cli/doc/tests.rs
index 7f2c18639..cfa87bf96 100644
--- a/cli/doc/tests.rs
+++ b/cli/doc/tests.rs
@@ -44,6 +44,10 @@ impl DocFileLoader for TestLoader {
#[tokio::test]
async fn export_fn() {
let source_code = r#"/**
+* @module foo
+*/
+
+/**
* Hello there, this is a multiline JSdoc.
*
* It has many lines
@@ -51,6 +55,9 @@ async fn export_fn() {
* Or not that many?
*/
export function foo(a: string, b?: number, cb: (...cbArgs: unknown[]) => void, ...args: unknown[]): void {
+ /**
+ * @todo document all the things.
+ */
console.log("Hello world");
}
"#;
@@ -143,7 +150,7 @@ export function foo(a: string, b?: number, cb: (...cbArgs: unknown[]) => void, .
"location": {
"col": 0,
"filename": "test.ts",
- "line": 8,
+ "line": 12,
},
"name": "foo",
});