This is an automated email from the ASF dual-hosted git repository. randall pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-annotator.git
commit d9dcd289357c27e85d92db980cbf7b7ac85e1d09 Author: Randall Leeds <[email protected]> AuthorDate: Wed Jul 22 23:16:52 2020 -0700 Fix remaining test typecheck failures --- packages/dom/test/text-quote/match.test.ts | 2 +- packages/dom/test/text-quote/utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/dom/test/text-quote/match.test.ts b/packages/dom/test/text-quote/match.test.ts index 4df937a..78ef7a5 100644 --- a/packages/dom/test/text-quote/match.test.ts +++ b/packages/dom/test/text-quote/match.test.ts @@ -205,7 +205,7 @@ async function testMatcher( function prettyNodeName(node: Node) { switch (node.nodeType) { case Node.TEXT_NODE: - const text = (node as Text).nodeValue; + const text = (node as Text).nodeValue || ''; return `#text "${text.length > 50 ? text.substring(0, 50) + '…' : text}"`; case Node.ELEMENT_NODE: return `<${(node as Element).tagName.toLowerCase()}>`; diff --git a/packages/dom/test/text-quote/utils.ts b/packages/dom/test/text-quote/utils.ts index a59fb06..511a89c 100644 --- a/packages/dom/test/text-quote/utils.ts +++ b/packages/dom/test/text-quote/utils.ts @@ -34,7 +34,7 @@ export function evaluateXPath(doc: Document, xpath: string): Node { assert.equal(nodes.length, 1, `Test suite contains XPath with ${nodes.length} results instead of 1: '${xpath}'` ); - return nodes[0]; + return nodes[0] as Node; } export function hydrateRange(rangeInfo: RangeInfo, doc: Document): Range {
