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();
|
|
|
|
}
|
|
|
|
});
|