Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(doclint): add basic tests for documentation parsers (#934)
This patch adds basic tests to verify javascript and markdown documentation parsers.
- Loading branch information
1 parent
41fd4b5
commit 8bcf550
Showing
5 changed files
with
176 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class A { | ||
constructor(delegate) { | ||
this.property1 = 1; | ||
this._property2 = 2; | ||
} | ||
|
||
get getter() { | ||
return null; | ||
} | ||
|
||
async method(foo, bar) { | ||
} | ||
} | ||
|
||
A.Events = { | ||
AnEvent: 'anevent' | ||
}; |
56 changes: 56 additions & 0 deletions
56
utils/doclint/check_public_api/test/09-js-builder/result.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"classes": [ | ||
{ | ||
"name": "A", | ||
"members": [ | ||
{ | ||
"name": "property1", | ||
"type": "property", | ||
"hasReturn": false, | ||
"async": false, | ||
"args": [] | ||
}, | ||
{ | ||
"name": "_property2", | ||
"type": "property", | ||
"hasReturn": false, | ||
"async": false, | ||
"args": [] | ||
}, | ||
{ | ||
"name": "constructor", | ||
"type": "method", | ||
"hasReturn": false, | ||
"async": false, | ||
"args": [ | ||
"delegate" | ||
] | ||
}, | ||
{ | ||
"name": "getter", | ||
"type": "property", | ||
"hasReturn": false, | ||
"async": false, | ||
"args": [] | ||
}, | ||
{ | ||
"name": "method", | ||
"type": "method", | ||
"hasReturn": true, | ||
"async": true, | ||
"args": [ | ||
"foo", | ||
"bar" | ||
] | ||
}, | ||
{ | ||
"name": "anevent", | ||
"type": "event", | ||
"hasReturn": false, | ||
"async": false, | ||
"args": [] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
### class: Foo | ||
|
||
This is a class. | ||
|
||
#### event: 'frame' | ||
- <[Frame]> | ||
|
||
This event is dispatched. | ||
|
||
#### foo.$(selector) | ||
- `selector` <[string]> A selector to query page for | ||
- returns: <[Promise]<[ElementHandle]>> | ||
|
||
The method runs document.querySelector. | ||
|
||
#### foo.url | ||
- <[string]> | ||
|
||
Contains the URL of the request. |
32 changes: 32 additions & 0 deletions
32
utils/doclint/check_public_api/test/10-md-builder/result.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"classes": [ | ||
{ | ||
"name": "Foo", | ||
"members": [ | ||
{ | ||
"name": "frame", | ||
"type": "event", | ||
"hasReturn": false, | ||
"async": false, | ||
"args": [] | ||
}, | ||
{ | ||
"name": "$", | ||
"type": "method", | ||
"hasReturn": true, | ||
"async": false, | ||
"args": [ | ||
"selector" | ||
] | ||
}, | ||
{ | ||
"name": "url", | ||
"type": "property", | ||
"hasReturn": false, | ||
"async": false, | ||
"args": [] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters