(input: string)
| 239 | } |
| 240 | |
| 241 | export function parseHtml(input: string): TestDocument { |
| 242 | // deno-lint-ignore no-explicit-any |
| 243 | const doc = new DOMParser().parseFromString(input, "text/html") as any; |
| 244 | Object.defineProperty(doc, "debug", { |
| 245 | // deno-lint-ignore no-console |
| 246 | value: () => console.log(prettyDom(doc)), |
| 247 | enumerable: false, |
| 248 | }); |
| 249 | return doc; |
| 250 | } |
| 251 | |
| 252 | export function assertSelector(doc: Document, selector: string) { |
| 253 | if (doc.querySelector(selector) === null) { |
no test coverage detected