diff --git a/test/__image_snapshots__/should generate favicons of a given size/favicon-48x48.png-snap.png b/test/__image_snapshots__/should generate favicons of a given size/favicon-48x48.png-snap.png new file mode 100644 index 00000000..e10967db Binary files /dev/null and b/test/__image_snapshots__/should generate favicons of a given size/favicon-48x48.png-snap.png differ diff --git a/test/__image_snapshots__/should generate favicons of a given size/favicon.ico_48x48.png-snap.png b/test/__image_snapshots__/should generate favicons of a given size/favicon.ico_48x48.png-snap.png new file mode 100644 index 00000000..38f87538 Binary files /dev/null and b/test/__image_snapshots__/should generate favicons of a given size/favicon.ico_48x48.png-snap.png differ diff --git a/test/__image_snapshots__/should generate favicons of a given size/favicon.ico_64x64.png-snap.png b/test/__image_snapshots__/should generate favicons of a given size/favicon.ico_64x64.png-snap.png new file mode 100644 index 00000000..5f43f371 Binary files /dev/null and b/test/__image_snapshots__/should generate favicons of a given size/favicon.ico_64x64.png-snap.png differ diff --git a/test/__snapshots__/pickedSizes.test.js.snap b/test/__snapshots__/pickedSizes.test.js.snap new file mode 100644 index 00000000..4757f675 --- /dev/null +++ b/test/__snapshots__/pickedSizes.test.js.snap @@ -0,0 +1,21 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should generate favicons of a given size 4`] = ` +Object { + "files": Array [], + "html": Array [ + "", + "", + ], + "images": Array [ + Object { + "contents": null, + "name": "favicon.ico", + }, + Object { + "contents": null, + "name": "favicon-48x48.png", + }, + ], +} +`; diff --git a/test/pickedSizes.test.js b/test/pickedSizes.test.js new file mode 100644 index 00000000..55d989ca --- /dev/null +++ b/test/pickedSizes.test.js @@ -0,0 +1,26 @@ +import favicons from "../src"; +import { logo_png } from "./util"; + +test("should generate favicons of a given size", async () => { + expect.assertions(1); + const result = await favicons(logo_png, { + icons: { + favicons: [ + { + name: "favicon.ico", + sizes: [ + { width: 48, height: 48 }, + { width: 64, height: 64 }, + ], + }, + "favicon-48x48.png", + ], + android: false, + appleIcon: false, + appleStartup: false, + windows: false, + yandex: false, + }, + }); + await expect(result).toMatchFaviconsSnapshot(); +});