diff --git a/packages/metascraper-logo-favicon/package.json b/packages/metascraper-logo-favicon/package.json index 67042195c..d37e9cbbd 100644 --- a/packages/metascraper-logo-favicon/package.json +++ b/packages/metascraper-logo-favicon/package.json @@ -31,7 +31,8 @@ }, "devDependencies": { "async-listen": "latest", - "ava": "5" + "ava": "5", + "got": "11" }, "engines": { "node": ">= 16" diff --git a/packages/metascraper-logo-favicon/test/favicon.js b/packages/metascraper-logo-favicon/test/favicon.js index 4ff0f03c4..c4852a24a 100644 --- a/packages/metascraper-logo-favicon/test/favicon.js +++ b/packages/metascraper-logo-favicon/test/favicon.js @@ -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', @@ -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 => {