mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
test(fixtures): add typed fixture registry + resolve guard (phase 1)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { existsSync, statSync } from "node:fs";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { fixtures, flattenFixturePaths, readFixture } from "../../fixtures/index.js";
|
||||
|
||||
describe("fixture registry resolves", () => {
|
||||
const paths = flattenFixturePaths(fixtures);
|
||||
|
||||
it("registers at least the known core fixtures", () => {
|
||||
expect(paths.length).toBeGreaterThan(50); // ~71 expected; floor is a sanity check
|
||||
});
|
||||
|
||||
it.each(paths)("exists and is a non-empty file: %s", (p) => {
|
||||
expect(existsSync(p), `missing fixture: ${p}`).toBe(true);
|
||||
expect(statSync(p).size, `zero-byte fixture: ${p}`).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it("readFixture returns bytes for the workhorse PNG", () => {
|
||||
expect(readFixture(fixtures.image.base.png200).byteLength).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user