1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-06-17 18:13:14 +02:00
blog/.jest/setup-test-env.ts

20 lines
565 B
TypeScript

import * as Gatsby from 'gatsby'
import '@testing-library/jest-dom/extend-expect'
import avatar from './__fixtures__/avatar.json'
import github from './__fixtures__/github.json'
import meta from './__fixtures__/meta.json'
import posts from './__fixtures__/posts.json'
import './__mocks__/matchMedia'
const useStaticQuery = jest.spyOn(Gatsby, 'useStaticQuery')
beforeAll(() => {
useStaticQuery.mockImplementation(() => ({
...meta,
...avatar,
logo: { edges: [{ node: { relativePath: 'apple-touch-icon.png' } }] },
...posts,
...github
}))
})