Add new tests

This commit is contained in:
Ethan Lane 2024-10-26 16:22:43 +01:00
parent 81437ede41
commit b1adc39a35
3 changed files with 50 additions and 4 deletions
src/helpers

View file

@ -12,10 +12,6 @@ export default class ImageHelper {
const dom = htmlparser.parseDocument(fetched.body);
const img = htmlparser.DomUtils.findAll((x => x.tagName == "img" && x.attributes.find(y => y.value.includes("https://preview.redd.it")) != null), dom.children);
if (!img) {
return [];
}
const imgSrc = img
.flatMap(x => x.attributes.find(x => x.name == "src")?.value)
.filter(x => x != undefined);