(c)
| 318 | * @returns {string} serialized tree |
| 319 | */ |
| 320 | const runTreeCase = (c) => { |
| 321 | const doc = buildHtmlAst(c.data, c.fragment || undefined); |
| 322 | // In fragment mode the result is the children of the synthesized root. |
| 323 | const root = |
| 324 | c.fragment && doc.children[0] |
| 325 | ? /** @type {import("../lib/html/syntax").HtmlDocument} */ ({ |
| 326 | type: NodeType.Document, |
| 327 | children: /** @type {import("../lib/html/syntax").HtmlElement} */ ( |
| 328 | doc.children[0] |
| 329 | ).children |
| 330 | }) |
| 331 | : doc; |
| 332 | return serialize(root); |
| 333 | }; |
| 334 | |
| 335 | const hasTreeCorpus = |
| 336 | fs.existsSync(treeDir) && fs.readdirSync(treeDir).length > 0; |
no test coverage detected