import { existsSync } from "node:fs"; import { join } from "node:path"; import manifest from "./manifest"; describe("manifest", () => { it("has a stable id at the site root", () => { expect(manifest().id).toBe("/"); }); it("lists the any and maskable icons in 192 and 512, in this order", () => { expect(manifest().icons).toEqual([ { src: "/brand/pwa-192.png", sizes: "192x192", type: "image/png", purpose: "any", }, { src: "/brand/pwa-512.png", sizes: "512x512", type: "image/png", purpose: "any", }, { src: "/brand/pwa-maskable-192.png", sizes: "192x192", type: "image/png", purpose: "maskable", }, { src: "/brand/pwa-maskable-512.png", sizes: "512x512", type: "image/png", purpose: "maskable", }, ]); }); it("points every icon to a file that exists in public/", () => { for (const { src } of manifest().icons ?? []) { expect(existsSync(join(process.cwd(), "public", src))).toBe(true); } }); });