Skip to content

Commit

Permalink
Merge pull request #739 from microlinkhq/logo-favicon
Browse files Browse the repository at this point in the history
fix(logo-favicon): test snapshots
  • Loading branch information
Kikobeats authored Jan 11, 2025
2 parents 0d091b3 + 5f997e3 commit 2c11034
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/metascraper-logo-favicon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
},
"devDependencies": {
"async-listen": "latest",
"ava": "5"
"ava": "5",
"got": "11"
},
"engines": {
"node": ">= 16"
Expand Down
4 changes: 3 additions & 1 deletion packages/metascraper-logo-favicon/test/favicon.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const { createFavicon } = require('..')

const { runServer } = require('./helpers')

const stripWWW = str => str.replace(/^https?:\/\/(www\.)?/, 'https://')

const faviconPNG = createFavicon(['png', ['image/png']])
const faviconICO = createFavicon([
'ico',
Expand Down Expand Up @@ -41,7 +43,7 @@ test("don't resolve favicon.ico with no valid content-type", async t => {

test("favicon.png with 'image/png' content-type", async t => {
const url = 'https://adroll.com/'
t.is(await faviconPNG(url), 'https://adroll.com/favicon.png')
t.is(stripWWW(await faviconPNG(url)), 'https://adroll.com/favicon.png')
})

test("favicon.ico with 'image/vnd.microsoft.icon' content-type", async t => {
Expand Down

0 comments on commit 2c11034

Please sign in to comment.