From a73e092fb5ee594a8f3ace52f12d9324700251a0 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Mon, 24 Jul 2023 12:56:05 +0100 Subject: [PATCH] Upgrade minimum version of sharp to 0.32.4 Ensure PNG to SVG test assertions are deterministic by verifying the output of the reverse SVG to PNG roundtrip and therefore existing thresholds, instead of snapshots of exact bytes. --- package-lock.json | 161 +++++++++++++----- package.json | 3 +- .../favicon-16x16.png-snap.png | Bin 0 -> 131 bytes .../favicon-32x32.png-snap.png | Bin 0 -> 236 bytes .../favicon-48x48.png-snap.png | Bin 0 -> 365 bytes .../favicon.ico_16x16.png-snap.png | Bin 0 -> 156 bytes .../favicon.ico_24x24.png-snap.png | Bin 0 -> 264 bytes .../favicon.ico_32x32.png-snap.png | Bin 0 -> 401 bytes .../favicon.ico_48x48.png-snap.png | Bin 0 -> 644 bytes .../favicon.ico_64x64.png-snap.png | Bin 0 -> 911 bytes test/__snapshots__/svgOutput.test.js.snap | 32 +++- test/svgOutput.test.js | 27 ++- 12 files changed, 172 insertions(+), 51 deletions(-) create mode 100644 test/__image_snapshots__/should generate svg favicon/favicon-16x16.png-snap.png create mode 100644 test/__image_snapshots__/should generate svg favicon/favicon-32x32.png-snap.png create mode 100644 test/__image_snapshots__/should generate svg favicon/favicon-48x48.png-snap.png create mode 100644 test/__image_snapshots__/should generate svg favicon/favicon.ico_16x16.png-snap.png create mode 100644 test/__image_snapshots__/should generate svg favicon/favicon.ico_24x24.png-snap.png create mode 100644 test/__image_snapshots__/should generate svg favicon/favicon.ico_32x32.png-snap.png create mode 100644 test/__image_snapshots__/should generate svg favicon/favicon.ico_48x48.png-snap.png create mode 100644 test/__image_snapshots__/should generate svg favicon/favicon.ico_64x64.png-snap.png diff --git a/package-lock.json b/package-lock.json index 3a96cff8..bb591605 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "escape-html": "^1.0.3", - "sharp": "^0.32.0", + "sharp": "^0.32.4", "xml2js": "^0.5.0" }, "devDependencies": { @@ -18,7 +18,6 @@ "@babel/preset-env": "^7.19.4", "@babel/preset-typescript": "^7.18.6", "@types/escape-html": "^1.0.2", - "@types/sharp": "^0.31.0", "@types/xml2js": "^0.4.11", "@typescript-eslint/eslint-plugin": "^5.40.1", "@typescript-eslint/parser": "^5.40.1", @@ -3397,15 +3396,6 @@ "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", "dev": true }, - "node_modules/@types/sharp": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@types/sharp/-/sharp-0.31.1.tgz", - "integrity": "sha512-5nWwamN9ZFHXaYEincMSuza8nNfOof8nmO+mcI+Agx1uMUk4/pQnNIcix+9rLPXzKrm1pS34+6WRDbDV0Jn7ag==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/stack-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", @@ -3824,6 +3814,11 @@ "node": ">=8" } }, + "node_modules/b4a": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz", + "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==" + }, "node_modules/babel-jest": { "version": "29.5.0", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.5.0.tgz", @@ -4478,9 +4473,9 @@ "dev": true }, "node_modules/detect-libc": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", - "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", + "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", "engines": { "node": ">=8" } @@ -5062,6 +5057,11 @@ "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", "dev": true }, + "node_modules/fast-fifo": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.0.tgz", + "integrity": "sha512-IgfweLvEpwyA4WgiQe9Nx6VV2QkML2NkvZnk1oKnIzXgXdWxuhF7zw4DvLTPZJn6PIUneiAXPF24QmoEqHTjyw==" + }, "node_modules/fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", @@ -7903,9 +7903,9 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/node-addon-api": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.0.0.tgz", - "integrity": "sha512-GyHvgPvUXBvAkXa0YvYnhilSB1A+FRYMpIVggKzPZqdaZfevZOuzfWzyvgzOwRLHBeo/MMswmJFsrNF4Nw1pmA==" + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", + "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==" }, "node_modules/node-int64": { "version": "0.4.0", @@ -8424,6 +8424,11 @@ } ] }, + "node_modules/queue-tick": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", + "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==" + }, "node_modules/rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -8788,18 +8793,18 @@ } }, "node_modules/sharp": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.0.tgz", - "integrity": "sha512-yLAypVcqj1toSAqRSwbs86nEzfyZVDYqjuUX8grhFpeij0DDNagKJXELS/auegDBRDg1XBtELdOGfo2X1cCpeA==", + "version": "0.32.4", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.4.tgz", + "integrity": "sha512-exUnZewqVZC6UXqXuQ8fyJJv0M968feBi04jb9GcUHrWtkRoAKnbJt8IfwT4NJs7FskArbJ14JAFGVuooszoGg==", "hasInstallScript": true, "dependencies": { "color": "^4.2.3", - "detect-libc": "^2.0.1", - "node-addon-api": "^6.0.0", + "detect-libc": "^2.0.2", + "node-addon-api": "^6.1.0", "prebuild-install": "^7.1.1", - "semver": "^7.3.8", + "semver": "^7.5.4", "simple-get": "^4.0.1", - "tar-fs": "^2.1.1", + "tar-fs": "^3.0.4", "tunnel-agent": "^0.6.0" }, "engines": { @@ -8834,6 +8839,26 @@ "node": ">=10" } }, + "node_modules/sharp/node_modules/tar-fs": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.4.tgz", + "integrity": "sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==", + "dependencies": { + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + } + }, + "node_modules/sharp/node_modules/tar-stream": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.6.tgz", + "integrity": "sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==", + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, "node_modules/sharp/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", @@ -8989,6 +9014,15 @@ "node": ">=8" } }, + "node_modules/streamx": { + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.0.tgz", + "integrity": "sha512-HcxY6ncGjjklGs1xsP1aR71INYcsXFJet5CU1CHqihQ2J5nOsbd4OjgjHO42w/4QNv9gZb3BueV+Vxok5pLEXg==", + "dependencies": { + "fast-fifo": "^1.1.0", + "queue-tick": "^1.0.1" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -11992,15 +12026,6 @@ "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", "dev": true }, - "@types/sharp": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@types/sharp/-/sharp-0.31.1.tgz", - "integrity": "sha512-5nWwamN9ZFHXaYEincMSuza8nNfOof8nmO+mcI+Agx1uMUk4/pQnNIcix+9rLPXzKrm1pS34+6WRDbDV0Jn7ag==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, "@types/stack-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", @@ -12279,6 +12304,11 @@ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, + "b4a": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz", + "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==" + }, "babel-jest": { "version": "29.5.0", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.5.0.tgz", @@ -12752,9 +12782,9 @@ "dev": true }, "detect-libc": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", - "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", + "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==" }, "detect-newline": { "version": "3.1.0", @@ -13167,6 +13197,11 @@ "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", "dev": true }, + "fast-fifo": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.0.tgz", + "integrity": "sha512-IgfweLvEpwyA4WgiQe9Nx6VV2QkML2NkvZnk1oKnIzXgXdWxuhF7zw4DvLTPZJn6PIUneiAXPF24QmoEqHTjyw==" + }, "fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", @@ -15281,9 +15316,9 @@ } }, "node-addon-api": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.0.0.tgz", - "integrity": "sha512-GyHvgPvUXBvAkXa0YvYnhilSB1A+FRYMpIVggKzPZqdaZfevZOuzfWzyvgzOwRLHBeo/MMswmJFsrNF4Nw1pmA==" + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", + "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==" }, "node-int64": { "version": "0.4.0", @@ -15642,6 +15677,11 @@ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true }, + "queue-tick": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", + "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==" + }, "rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -15890,17 +15930,17 @@ "dev": true }, "sharp": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.0.tgz", - "integrity": "sha512-yLAypVcqj1toSAqRSwbs86nEzfyZVDYqjuUX8grhFpeij0DDNagKJXELS/auegDBRDg1XBtELdOGfo2X1cCpeA==", + "version": "0.32.4", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.4.tgz", + "integrity": "sha512-exUnZewqVZC6UXqXuQ8fyJJv0M968feBi04jb9GcUHrWtkRoAKnbJt8IfwT4NJs7FskArbJ14JAFGVuooszoGg==", "requires": { "color": "^4.2.3", - "detect-libc": "^2.0.1", - "node-addon-api": "^6.0.0", + "detect-libc": "^2.0.2", + "node-addon-api": "^6.1.0", "prebuild-install": "^7.1.1", - "semver": "^7.3.8", + "semver": "^7.5.4", "simple-get": "^4.0.1", - "tar-fs": "^2.1.1", + "tar-fs": "^3.0.4", "tunnel-agent": "^0.6.0" }, "dependencies": { @@ -15920,6 +15960,26 @@ "lru-cache": "^6.0.0" } }, + "tar-fs": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.4.tgz", + "integrity": "sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==", + "requires": { + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + } + }, + "tar-stream": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.6.tgz", + "integrity": "sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==", + "requires": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", @@ -16035,6 +16095,15 @@ } } }, + "streamx": { + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.0.tgz", + "integrity": "sha512-HcxY6ncGjjklGs1xsP1aR71INYcsXFJet5CU1CHqihQ2J5nOsbd4OjgjHO42w/4QNv9gZb3BueV+Vxok5pLEXg==", + "requires": { + "fast-fifo": "^1.1.0", + "queue-tick": "^1.0.1" + } + }, "string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", diff --git a/package.json b/package.json index 28227908..b41776e7 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ }, "dependencies": { "escape-html": "^1.0.3", - "sharp": "^0.32.0", + "sharp": "^0.32.4", "xml2js": "^0.5.0" }, "devDependencies": { @@ -60,7 +60,6 @@ "@babel/preset-env": "^7.19.4", "@babel/preset-typescript": "^7.18.6", "@types/escape-html": "^1.0.2", - "@types/sharp": "^0.31.0", "@types/xml2js": "^0.4.11", "@typescript-eslint/eslint-plugin": "^5.40.1", "@typescript-eslint/parser": "^5.40.1", diff --git a/test/__image_snapshots__/should generate svg favicon/favicon-16x16.png-snap.png b/test/__image_snapshots__/should generate svg favicon/favicon-16x16.png-snap.png new file mode 100644 index 0000000000000000000000000000000000000000..ed1eb1b7dafc46c5c5950f3d6ad01d6647e655e9 GIT binary patch literal 131 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9G0FF=@aYjsdIP|(!V z#WAE}PI7_-t4ia4TigGdmv|0~WFE_An6yY_l4-KWySKh7p2m98CqJ3H&br8}=>3_4 anIS?c>rD5HpH4sn7(8A5T-G@yGywo!Cnm!H literal 0 HcmV?d00001 diff --git a/test/__image_snapshots__/should generate svg favicon/favicon-32x32.png-snap.png b/test/__image_snapshots__/should generate svg favicon/favicon-32x32.png-snap.png new file mode 100644 index 0000000000000000000000000000000000000000..8eed3c90dba0b6b9678b35c10593acf0c9b436fc GIT binary patch literal 236 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?507a+{IwK^ypC^*m4 z#WAE}&fCeSIU5Xk9AuAh{_$DR_mHV8yW)e&lCxRw9x-iXx95lo@hLvpe8=ma@&%0` z5!b|~V}@!Cj&6Cme#b6YZC+xN(_&p&rg(qZlqr|LA3f&tZq3&3yh*22?ZqN*pFG*$ z@$Czn!o!KmVe^jiuCD1Xh<_f&aAET)dDnu|`(6I%)e9d~s~0+`_uZ9ca=a_c^!I`t htutZ*r|gep=sB^j?}Ah59H2`XJYD@<);T3K0RUJuUDW^p literal 0 HcmV?d00001 diff --git a/test/__image_snapshots__/should generate svg favicon/favicon-48x48.png-snap.png b/test/__image_snapshots__/should generate svg favicon/favicon-48x48.png-snap.png new file mode 100644 index 0000000000000000000000000000000000000000..c1430a19eca384aeeb2163efcc5f768e4ff0df24 GIT binary patch literal 365 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC&H|6fVg?507a+{IwK^!9fq_xp z)5S5QV$R#?-h5340&TYK-ghe)zY0}x#ES=-M<^7D&!7ImVb_Z0u9oQ~92TlS_oqzT za^L5_$N!HU(?bn`AcGe+C-MMmY?SA#Qvl|S58rU8F#cGr9!hPRfT4%Uuxv-?Z`O+h1(Kr+bCH_jR7ES7CDQtbDb*c}LBO!=>sx6D6bf zb>3K_xY5-4McUCP#=aMBABi|)_Vd>42^0RC9qgQ(`{};gs(CHEp9J5i1f-Hj3Bj?Zcf9COL$Vc7th+_Y5Dgn+o5$DvrIO`?FU-N;OXk;vd$@? F2>_v&I%EI< literal 0 HcmV?d00001 diff --git a/test/__image_snapshots__/should generate svg favicon/favicon.ico_24x24.png-snap.png b/test/__image_snapshots__/should generate svg favicon/favicon.ico_24x24.png-snap.png new file mode 100644 index 0000000000000000000000000000000000000000..5901221f296f849346c5643202afc9223b0cd3c6 GIT binary patch literal 264 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`Gj=RI8?p!=Vdm21 zdxc~!vT*L)Yu|q3F`K~D9ZYA~wm3M*GkdsM)y}OIniLs<&HOxXKZh{O!yq#HSRU|N4uwQ&oAhwzAbEX_b3#wHlcB-Q3Q< z`s(q=b^qIxz1`gSa@Hn0Ii|@Qq}fOBIxG&-o@ch+qH#vT$sH}Rk{1iz4zg@>JEO?% zR&qw++=djNjX<;X9L{V=>A5*oP*z-P#=&bH@=p$Q^c{WVU&~bWJmed*BVQ=cYYd*Q KelF{r5}E)4re;9^ literal 0 HcmV?d00001 diff --git a/test/__image_snapshots__/should generate svg favicon/favicon.ico_32x32.png-snap.png b/test/__image_snapshots__/should generate svg favicon/favicon.ico_32x32.png-snap.png new file mode 100644 index 0000000000000000000000000000000000000000..c3012993bff79ef60cc35f5fdcbb0e7c61e60138 GIT binary patch literal 401 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=hEVFh+Q~IEGX(zCCE0cf~=X;o6dI5C+r;JH;NbjO z8KEQA-JbOPxxdcR?Qaxp7^2soH@N-ju6SUrOY7qUIeYC6=bZNU{jjfl>6adhM-4hl zgU@Wcvvt#)`G$`=m^V)G6RdP^T@hz+Xk+u!J)F6}EvJ2&$0gk+{Gf{~P*h7sSSOuX zj(NS)?Ygd|F`w9h5_$RSR|teAHZ49>WLEcGY0KN=5vSVZb(SVSm<7~PR?xE{v7+y0 z_PZ*{J^ux~Z$@|>?}!OjTy==Ysr6|M^BRfdZ)_7iT32uxa|-J`mrgh;=Ms9OIoU~P zDgV84hr>LJwBDTD=nUnt1d6^pXb9tR0C^`3gQ0TzE}=iT`)rQ{{d!Q#Zc?MX>d^j# i!yl#`P5QY12iMbuRSyI+^XzI5iXAacFtlT|S?>|A z-LgBSD8{h+Bjqpk)Gy676*guZfImUi~({f3WBF~!z2}k5N zsGYBkUTgPMU+gjS1LdL_XGISk=yPFWsE^TN8%Ry*+Xm$_RiL{cILJi53VId&KHcHy zHjs@n6O!3uy=q_oOaGwbx)nV_dYZnn>$) zCi_G6RLl+0YH9R-V$lG!HdaUGl3=~@?A4iOF-Ck-94+RF3n-8X>nM=R%S-zl>mCN{DQ*~?7 z#6686<}MpAg%z3GcXKTIx&8dVowu8xe?Iux<~$6&-*jPj`F4>ORnF->eaB<{{P#0{ zYh2#)aCy<|YyLVKPlPT$ESSG-E|dI+L!lx0OZMI?3=37)QFt=x!ovdjtDGCo*1I}P z`c`#3GIZ_(plX=tYJ{jl%Hfvu^|o_U*CWP875+y-j2);{*cLTK88)XYFzCzpm`7rV&^A1HEPxR}uo z^aMz=&p9S1u_dXM95RYZdjuHRGxz_G4h!usT(J0}T&^{v6EOq}*qv7r6B@Pn#b@9j^odc~Q)z;&bdZNEmocWWdj zZ(bt69yLv#IsQW#Q;h%bzv)0T9*S$-;bMk*i z;2S2W;cGk^xF^~d2s7|+)ye - + ", "name": "favicon.svg", }, @@ -17,6 +17,36 @@ exports[`should generate svg favicon 1`] = ` } `; +exports[`should generate svg favicon 10`] = ` +{ + "files": [], + "html": [ + "", + "", + "", + "", + ], + "images": [ + { + "contents": null, + "name": "favicon.ico", + }, + { + "contents": null, + "name": "favicon-16x16.png", + }, + { + "contents": null, + "name": "favicon-32x32.png", + }, + { + "contents": null, + "name": "favicon-48x48.png", + }, + ], +} +`; + exports[`should reuse svg as a favicon 1`] = ` { "files": [], diff --git a/test/svgOutput.test.js b/test/svgOutput.test.js index d4fe465c..2a5aa41d 100644 --- a/test/svgOutput.test.js +++ b/test/svgOutput.test.js @@ -19,7 +19,7 @@ test("should reuse svg as a favicon", async () => { }); test("should generate svg favicon", async () => { - expect.assertions(1); + expect.assertions(2); const result = await favicons(logo_png, { icons: { @@ -32,5 +32,28 @@ test("should generate svg favicon", async () => { }, }); - await expect(result).toMatchFaviconsSnapshot(); + const svg = result.images[0].contents; + const deterministicSvg = Buffer.from( + svg.toString().replace(/png;base64,[^"]+/, "") + ); + await expect({ + ...result, + images: [ + { + ...result.images[0], + contents: deterministicSvg, + }, + ], + }).toMatchFaviconsSnapshot(); + + const roundtripResult = await favicons(svg, { + icons: { + android: false, + appleIcon: false, + appleStartup: false, + windows: false, + yandex: false, + }, + }); + await expect(roundtripResult).toMatchFaviconsSnapshot(); });