(html)
| 2072 | * @returns {{ code: string, slice: string, severity: string }[]} list of reported errors |
| 2073 | */ |
| 2074 | const collectErrors = (html) => { |
| 2075 | /** @type {{ code: string, slice: string, severity: string }[]} */ |
| 2076 | const errors = []; |
| 2077 | walkHtmlTokens(html, 0, { |
| 2078 | parseError: (input, code, start, end, severity) => { |
| 2079 | errors.push({ code, slice: input.slice(start, end), severity }); |
| 2080 | } |
| 2081 | }); |
| 2082 | return errors; |
| 2083 | }; |
| 2084 | |
| 2085 | it("reports missing-attribute-value as a warning", () => { |
| 2086 | const errors = collectErrors("<a foo=>"); |
no test coverage detected