mirror of
https://github.com/morluto/rea.git
synced 2026-12-03 17:44:27 +00:00
fix(tests): narrow markdown-it attributes to strings in doc link checks (#14217)
Token.attrGet returns string | number | null, so the link checks added in #14207 failed typecheck on main. Keep only string href values before matching them.
This commit is contained in:
1 parent
df6454c3fd
commit
e39b56fc5d
2 files changed
+5
-4
No files matched your search
@@ -110,9 +110,10 @@ it("links to the workflow asset outside the documentation site's base", async ()
|
||||
const workflowLinks = new MarkdownIt()
|
||||
.parse(guide, {})
|
||||
.flatMap((token) => token.children ?? [])
|
||||
.flatMap((token) =>
|
||||
token.type === "link_open" ? [token.attrGet("href") ?? ""] : [],
|
||||
)
|
||||
.flatMap((token) => {
|
||||
const href = token.type === "link_open" ? token.attrGet("href") : null;
|
||||
return typeof href === "string" ? [href] : [];
|
||||
})
|
||||
.filter((href) =>
|
||||
href.endsWith("examples/github-actions/rea-analysis.yml"),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user