Since #300 fixed #291, cover it with tests. Fixes #291

This commit is contained in:
Tom MacWright 2015-12-10 17:00:12 -05:00
parent 71f778bcb1
commit d95026ea8b
4 changed files with 292 additions and 2 deletions

View File

@ -13,3 +13,15 @@ function addThem(a, b, c, { d, e, f }) {
function fishesAndFoxes({ fishes, foxes }) {
return fishes + foxes;
}
/**
* This is foo's documentation
*/
class Foo {
/**
* The method
* @param {number} x Param to method
*/
method(x) {
}
}

View File

@ -34,7 +34,7 @@
"column": 1
}
},
"code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n"
"code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n\n/**\n * This is foo's documentation\n */\nclass Foo {\n /**\n * The method\n * @param {number} x Param to method\n */\n method(x) {\n }\n}\n"
},
"errors": [],
"params": [
@ -129,7 +129,7 @@
"column": 1
}
},
"code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n"
"code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n\n/**\n * This is foo's documentation\n */\nclass Foo {\n /**\n * The method\n * @param {number} x Param to method\n */\n method(x) {\n }\n}\n"
},
"errors": [],
"params": [
@ -168,5 +168,106 @@
"path": [
"fishesAndFoxes"
]
},
{
"description": "This is foo's documentation",
"tags": [],
"loc": {
"start": {
"line": 17,
"column": 0
},
"end": {
"line": 19,
"column": 3
}
},
"context": {
"loc": {
"start": {
"line": 20,
"column": 0
},
"end": {
"line": 27,
"column": 1
}
},
"code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n\n/**\n * This is foo's documentation\n */\nclass Foo {\n /**\n * The method\n * @param {number} x Param to method\n */\n method(x) {\n }\n}\n"
},
"errors": [],
"name": "Foo",
"kind": "class",
"members": {
"instance": [
{
"description": "The method",
"tags": [
{
"title": "param",
"description": "Param to method",
"lineNumber": 2,
"type": {
"type": "NameExpression",
"name": "number"
},
"name": "x"
}
],
"loc": {
"start": {
"line": 21,
"column": 2
},
"end": {
"line": 24,
"column": 5
}
},
"context": {
"loc": {
"start": {
"line": 25,
"column": 2
},
"end": {
"line": 26,
"column": 3
}
},
"code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n\n/**\n * This is foo's documentation\n */\nclass Foo {\n /**\n * The method\n * @param {number} x Param to method\n */\n method(x) {\n }\n}\n"
},
"errors": [],
"params": [
{
"title": "param",
"description": "Param to method",
"lineNumber": 2,
"type": {
"type": "NameExpression",
"name": "number"
},
"name": "x"
}
],
"name": "method",
"kind": "function",
"memberof": "Foo",
"scope": "instance",
"members": {
"instance": [],
"static": []
},
"path": [
"Foo",
"method"
]
}
],
"static": []
},
"path": [
"Foo"
]
}
]

View File

@ -21,3 +21,15 @@ This method has partially inferred params
- `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)**
- `$0.fishes` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** number of kinds of fish
- `$0.foxes`
# Foo
This is foo's documentation
## method
The method
**Parameters**
- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Param to method

View File

@ -466,6 +466,171 @@
]
}
]
},
{
"depth": 1,
"type": "heading",
"children": [
{
"type": "text",
"value": "Foo"
}
]
},
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "This is foo's documentation",
"position": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 28
},
"indent": []
}
}
],
"position": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 28
},
"indent": []
}
},
{
"depth": 2,
"type": "heading",
"children": [
{
"type": "text",
"value": "method"
}
]
},
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "The method",
"position": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 11
},
"indent": []
}
}
],
"position": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 11
},
"indent": []
}
},
{
"type": "strong",
"children": [
{
"type": "text",
"value": "Parameters"
}
]
},
{
"ordered": false,
"type": "list",
"children": [
{
"type": "listItem",
"children": [
{
"type": "paragraph",
"children": [
{
"type": "inlineCode",
"value": "x"
},
{
"type": "text",
"value": " "
},
{
"type": "strong",
"children": [
{
"href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
"type": "link",
"children": [
{
"type": "text",
"value": "number"
}
]
}
]
},
{
"type": "text",
"value": " "
},
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Param to method",
"position": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 16
},
"indent": []
}
}
],
"position": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 16
},
"indent": []
}
}
]
}
]
}
]
}
]
}