aotds-docks/src/lib/components/screenshots.test.ts

23 lines
548 B
TypeScript
Raw Normal View History

2023-03-21 15:42:09 +00:00
import { test, expect } from "vitest";
import { globby } from "globby";
import { readFileSync } from "fs";
import { toMatchImageSnapshot } from "jest-image-snapshot";
declare global {
namespace jest {
interface Matchers<R> {
toMatchImageSnapshot(): R;
}
}
}
expect.extend({ toMatchImageSnapshot });
2023-05-11 16:54:17 +00:00
test.skip("image snapshot", async () => {
2023-03-21 15:42:09 +00:00
const images = await globby(".histoire/screenshots/**.png");
for (const path of images) {
expect(readFileSync(path)).toMatchImageSnapshot();
}
});