Fix html extraction tests

zio/stable
Paul Frazee 2023-01-19 14:30:33 -06:00
parent 8d7566f200
commit 90d6d75af1
1 changed files with 3 additions and 3 deletions

View File

@ -41,7 +41,7 @@ describe('extractHtmlMeta', () => {
it.each(cases)( it.each(cases)(
'given the html tag %p, returns %p', 'given the html tag %p, returns %p',
(input, expectedResult) => { (input, expectedResult) => {
const output = extractHtmlMeta(input) const output = extractHtmlMeta({html: input as string, hostname: ''})
expect(output).toEqual(expectedResult) expect(output).toEqual(expectedResult)
}, },
) )
@ -52,7 +52,7 @@ describe('extractHtmlMeta', () => {
title: 'Example Domain', title: 'Example Domain',
description: 'An example website', description: 'An example website',
} }
const output = extractHtmlMeta(input) const output = extractHtmlMeta({html: input, hostname: 'example.com'})
expect(output).toEqual(expectedOutput) expect(output).toEqual(expectedOutput)
}) })
@ -64,7 +64,7 @@ describe('extractHtmlMeta', () => {
'Stunning HD Video ( 1080p ) of Patagonian Nature with Relaxing Native American Shamanic Music. HD footage used from ', 'Stunning HD Video ( 1080p ) of Patagonian Nature with Relaxing Native American Shamanic Music. HD footage used from ',
image: 'https://i.ytimg.com/vi/x6UITRjhijI/sddefault.jpg', image: 'https://i.ytimg.com/vi/x6UITRjhijI/sddefault.jpg',
} }
const output = extractHtmlMeta(input) const output = extractHtmlMeta({html: input, hostname: 'youtube.com'})
expect(output).toEqual(expectedOutput) expect(output).toEqual(expectedOutput)
}) })
}) })