import { describe, expect, it } from 'vitest'; import { encodePng, toBitmap } from './encode'; import { readPngSize } from './logo'; describe('readPngSize', () => { it('reads the dimensions a PNG declares', () => { // Built rather than fixtured, so the test cannot drift from the encoder. const rgba = Buffer.alloc(17 * 5 * 4, 255); const png = encodePng(toBitmap(rgba, 17, 5)); expect(readPngSize(png)).toEqual({ width: 17, height: 5 }); }); });