Add e2e tests for _ and $ JS identifiers

This commit is contained in:
Iván Sánchez Ortega
2020-09-08 18:31:22 +02:00
parent b0ede91b3b
commit 00a0497f3b
4 changed files with 119 additions and 0 deletions

View File

@ -0,0 +1,8 @@
// 🍂class $
// jQuery stuff.
// 🍂function _each(arr: Array, fn: Function): undefined
// Returns a random number between 0.0 and 1.0
export function _each(foo, bar) {
// Do something here.
}

View File

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<style>
table {
border-collapse: collapse;
}
table td, table th {
border: 1px solid #888;
}
pre code {
display: inline-block;
background: #eee;
}
td:last-child code {
background: #eee;
}
body {
font-family: Sans;
}
</style>
</head>
<body>
<h2>Leafdoc generated API reference</h2>
<h2 id='$'>$</h2>
<p>jQuery stuff.</p>
<h3 id='$-function'>Functions</h3>
<section>
<table><thead>
<tr>
<th>Function</th>
<th>Returns</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr id='$-_each'>
<td><code><b>_each</b>(<nobr>&lt;Array&gt; <i>arr</i></nobr>, <nobr>&lt;Function&gt; <i>fn</i></nobr>)</nobr></code></td>
<td><code>undefined</code></td>
<td>Returns a random number between 0.0 and 1.0</td>
</tr>
</tbody></table>
</section>
</body></html>

View File

@ -0,0 +1,53 @@
{
"$": {
"name": "$",
"aka": [],
"comments": [
"jQuery stuff."
],
"supersections": {
"function": {
"name": "function",
"aka": [],
"comments": [],
"sections": {
"__default": {
"name": "__default",
"aka": [],
"comments": [],
"uninheritable": false,
"documentables": {
"_each": {
"name": "_each",
"aka": [],
"comments": [
"Returns a random number between 0.0 and 1.0"
],
"params": {
"arr": {
"name": "arr",
"type": "Array"
},
"fn": {
"name": "fn",
"type": "Function"
}
},
"type": "undefined",
"optional": false,
"defaultValue": null,
"id": "$-_each"
}
},
"type": "function",
"id": "$-function"
}
},
"id": "$-function"
}
},
"inherits": [],
"relationships": [],
"id": "$"
}
}

View File

@ -0,0 +1,4 @@
{
"templateDir": "./templates/basic",
"leadingCharacter": "🍂"
}