* Builds the string containing the expected DOM present given the LView and TNode * values for a readable error message * * @param lView the lView containing the DOM * @param tNode the tNode * @param isViewContainerAnchor boolean * @returns string
(lView: LView, tNode: TNode, isViewContainerAnchor: boolean)
| 342 | * @returns string |
| 343 | */ |
| 344 | function describeExpectedDom(lView: LView, tNode: TNode, isViewContainerAnchor: boolean): string { |
| 345 | const spacer = ' '; |
| 346 | let content = ''; |
| 347 | if (tNode.prev) { |
| 348 | content += spacer + '…\n'; |
| 349 | content += spacer + describeTNode(tNode.prev) + '\n'; |
| 350 | } else if (tNode.type && tNode.type & TNodeType.AnyContainer) { |
| 351 | content += spacer + '…\n'; |
| 352 | } |
| 353 | if (isViewContainerAnchor) { |
| 354 | content += spacer + describeTNode(tNode) + '\n'; |
| 355 | content += spacer + `<!-- container --> ${AT_THIS_LOCATION}\n`; |
| 356 | } else { |
| 357 | content += spacer + describeTNode(tNode) + ` ${AT_THIS_LOCATION}\n`; |
| 358 | } |
| 359 | content += spacer + '…\n'; |
| 360 | |
| 361 | const parentRNode = tNode.type ? getParentRElement(lView[TVIEW], tNode, lView) : null; |
| 362 | if (parentRNode) { |
| 363 | content = describeRNode(parentRNode as unknown as Node, '\n' + content); |
| 364 | } |
| 365 | return content; |
| 366 | } |
| 367 | |
| 368 | /** |
| 369 | * Builds the string containing the DOM present around a given RNode for a |
no test coverage detected
searching dependent graphs…