// The toolbar icons in icons/ are drawn by script/lib/icons.js (`make icons`). // Each committed file must be exactly what it draws, byte for byte, so the // drawing and the files cannot drift apart: change the drawing, then run // `make icons` and commit the files with it. const fs = require("fs"); const path = require("path"); const { icons } = require("../manifest/chrome.json"); const { drawIcon } = require("../script/lib/icons"); describe("toolbar icons", () => { test.each(Object.entries(icons))( "the %spx icon %s is what script/lib/icons.js draws", (size, file) => { const committed = fs.readFileSync(path.join(__dirname, "..", file)); expect(drawIcon(Number(size))).toEqual(committed); }, ); });