mirror of
https://github.com/vitest-dev/vitest.git
synced 2025-12-08 18:26:03 +00:00
18 lines
394 B
TypeScript
18 lines
394 B
TypeScript
import { readFileSync } from 'fs'
|
|
import { expect, test } from 'vitest'
|
|
import { toMatchImageSnapshot } from 'jest-image-snapshot'
|
|
|
|
declare global {
|
|
namespace jest {
|
|
interface Matchers<R> {
|
|
toMatchImageSnapshot(): R
|
|
}
|
|
}
|
|
}
|
|
|
|
expect.extend({ toMatchImageSnapshot })
|
|
|
|
test('image snapshot', () => {
|
|
expect(readFileSync('./test/stubs/input-image.png')).toMatchImageSnapshot()
|
|
})
|