From ec4d428863a4aa670338b22439031495911fbd1b Mon Sep 17 00:00:00 2001
From: Matt Mayer <152770+matthewmayer@users.noreply.github.com>
Date: Sun, 16 Apr 2023 20:03:38 +0700
Subject: docs: document @throws parameter in API docs (#2050)
---
.../apidoc/__snapshots__/signature.spec.ts.snap | 75 ++++++++++++++++------
test/scripts/apidoc/signature.example.ts | 10 +++
2 files changed, 66 insertions(+), 19 deletions(-)
(limited to 'test/scripts')
diff --git a/test/scripts/apidoc/__snapshots__/signature.spec.ts.snap b/test/scripts/apidoc/__snapshots__/signature.spec.ts.snap
index bd916f0e..15bb4d00 100644
--- a/test/scripts/apidoc/__snapshots__/signature.spec.ts.snap
+++ b/test/scripts/apidoc/__snapshots__/signature.spec.ts.snap
@@ -43,7 +43,8 @@ exports[`signature > analyzeSignature() > complexArrayParameter 1`] = `
"returns": "T",
"seeAlsos": [],
"since": "",
- "sourcePath": "test/scripts/apidoc/signature.example.ts#L346",
+ "sourcePath": "test/scripts/apidoc/signature.example.ts#L356",
+ "throws": undefined,
}
`;
@@ -67,7 +68,8 @@ exports[`signature > analyzeSignature() > defaultBooleanParamMethod 1`] = `
"returns": "number",
"seeAlsos": [],
"since": "",
- "sourcePath": "test/scripts/apidoc/signature.example.ts#L104",
+ "sourcePath": "test/scripts/apidoc/signature.example.ts#L105",
+ "throws": undefined,
}
`;
@@ -83,6 +85,7 @@ exports[`signature > analyzeSignature() > expected and actual methods are equal
"methodWithMultipleSeeMarkers",
"methodWithMultipleSeeMarkersAndBackticks",
"methodWithSinceMarker",
+ "methodWithThrows",
"multiParamMethod",
"noParamMethod",
"optionalStringParamMethod",
@@ -115,7 +118,8 @@ exports[`signature > analyzeSignature() > functionParamMethod 1`] = `
"returns": "number",
"seeAlsos": [],
"since": "",
- "sourcePath": "test/scripts/apidoc/signature.example.ts#L124",
+ "sourcePath": "test/scripts/apidoc/signature.example.ts#L125",
+ "throws": undefined,
}
`;
@@ -174,7 +178,8 @@ exports[`signature > analyzeSignature() > literalUnionParamMethod 1`] = `
"returns": "string",
"seeAlsos": [],
"since": "",
- "sourcePath": "test/scripts/apidoc/signature.example.ts#L158",
+ "sourcePath": "test/scripts/apidoc/signature.example.ts#L159",
+ "throws": undefined,
}
`;
@@ -193,7 +198,8 @@ exports[`signature > analyzeSignature() > methodWithDeprecated 1`] = `
"test.apidoc.methodWithExample()",
],
"since": "",
- "sourcePath": "test/scripts/apidoc/signature.example.ts#L276",
+ "sourcePath": "test/scripts/apidoc/signature.example.ts#L277",
+ "throws": undefined,
}
`;
@@ -244,7 +250,8 @@ exports[`signature > analyzeSignature() > methodWithDeprecatedOption 1`] = `
"returns": "number",
"seeAlsos": [],
"since": "",
- "sourcePath": "test/scripts/apidoc/signature.example.ts#L288",
+ "sourcePath": "test/scripts/apidoc/signature.example.ts#L298",
+ "throws": undefined,
}
`;
@@ -261,7 +268,8 @@ exports[`signature > analyzeSignature() > methodWithExample 1`] = `
"returns": "number",
"seeAlsos": [],
"since": "",
- "sourcePath": "test/scripts/apidoc/signature.example.ts#L265",
+ "sourcePath": "test/scripts/apidoc/signature.example.ts#L266",
+ "throws": undefined,
}
`;
@@ -280,7 +288,8 @@ exports[`signature > analyzeSignature() > methodWithMultipleSeeMarkers 1`] = `
"test.apidoc.methodWithDeprecated()",
],
"since": "",
- "sourcePath": "test/scripts/apidoc/signature.example.ts#L315",
+ "sourcePath": "test/scripts/apidoc/signature.example.ts#L325",
+ "throws": undefined,
}
`;
@@ -299,7 +308,8 @@ exports[`signature > analyzeSignature() > methodWithMultipleSeeMarkersAndBacktic
"test.apidoc.methodWithDeprecated() with parameter bar and baz.",
],
"since": "",
- "sourcePath": "test/scripts/apidoc/signature.example.ts#L325",
+ "sourcePath": "test/scripts/apidoc/signature.example.ts#L335",
+ "throws": undefined,
}
`;
@@ -315,7 +325,25 @@ exports[`signature > analyzeSignature() > methodWithSinceMarker 1`] = `
"returns": "number",
"seeAlsos": [],
"since": "1.0.0",
- "sourcePath": "test/scripts/apidoc/signature.example.ts#L334",
+ "sourcePath": "test/scripts/apidoc/signature.example.ts#L344",
+ "throws": undefined,
+}
+`;
+
+exports[`signature > analyzeSignature() > methodWithThrows 1`] = `
+{
+ "deprecated": undefined,
+ "description": "
Test with throws
+", + "examples": "methodWithThrows(): number
+