fix: format E2E tests and add helpers to knip ignore

This commit is contained in:
Your Name 2026-01-23 00:26:11 +08:00
parent a9f6e1de6f
commit 56161ed2e1
4 changed files with 81 additions and 23 deletions

View file

@ -125,15 +125,75 @@ export function createTestSvg(outputPath: string): void {
export function createTestPng(outputPath: string): void {
// 最小的有效 PNG 檔案 (1x1 紅色像素)
const pngBuffer = Buffer.from([
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, // PNG signature
0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, // IHDR chunk
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, // 1x1 dimensions
0x08, 0x02, 0x00, 0x00, 0x00, 0x90, 0x77, 0x53, 0xde, // bit depth, color type, etc
0x00, 0x00, 0x00, 0x0c, 0x49, 0x44, 0x41, 0x54, // IDAT chunk
0x08, 0xd7, 0x63, 0xf8, 0xcf, 0xc0, 0x00, 0x00, // compressed data
0x01, 0x01, 0x01, 0x00, 0x18, 0xdd, 0x8d, 0xb4, // checksum
0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, // IEND chunk
0xae, 0x42, 0x60, 0x82,
0x89,
0x50,
0x4e,
0x47,
0x0d,
0x0a,
0x1a,
0x0a, // PNG signature
0x00,
0x00,
0x00,
0x0d,
0x49,
0x48,
0x44,
0x52, // IHDR chunk
0x00,
0x00,
0x00,
0x01,
0x00,
0x00,
0x00,
0x01, // 1x1 dimensions
0x08,
0x02,
0x00,
0x00,
0x00,
0x90,
0x77,
0x53,
0xde, // bit depth, color type, etc
0x00,
0x00,
0x00,
0x0c,
0x49,
0x44,
0x41,
0x54, // IDAT chunk
0x08,
0xd7,
0x63,
0xf8,
0xcf,
0xc0,
0x00,
0x00, // compressed data
0x01,
0x01,
0x01,
0x00,
0x18,
0xdd,
0x8d,
0xb4, // checksum
0x00,
0x00,
0x00,
0x00,
0x49,
0x45,
0x4e,
0x44, // IEND chunk
0xae,
0x42,
0x60,
0x82,
]);
writeFileSync(outputPath, pngBuffer);
}