-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests to demonstrate how selection of sizes works
- Loading branch information
Showing
5 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+643 Bytes
...snapshots__/should generate favicons of a given size/favicon-48x48.png-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.25 KB
...shots__/should generate favicons of a given size/favicon.ico_48x48.png-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.81 KB
...shots__/should generate favicons of a given size/favicon.ico_64x64.png-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 [ | ||
"<link rel=\\"icon\\" type=\\"image/x-icon\\" href=\\"/favicon.ico\\">", | ||
"<link rel=\\"icon\\" type=\\"image/png\\" sizes=\\"48x48\\" href=\\"/favicon-48x48.png\\">", | ||
], | ||
"images": Array [ | ||
Object { | ||
"contents": null, | ||
"name": "favicon.ico", | ||
}, | ||
Object { | ||
"contents": null, | ||
"name": "favicon-48x48.png", | ||
}, | ||
], | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
}); |