1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-29 07:26:22 +01:00
blog/.jest/setup-test-env.ts

20 lines
565 B
TypeScript
Raw Normal View History

2023-01-29 22:58:19 +01:00
import * as Gatsby from 'gatsby'
2019-10-11 23:50:03 +02:00
import '@testing-library/jest-dom/extend-expect'
2023-01-29 22:58:19 +01:00
import avatar from './__fixtures__/avatar.json'
import github from './__fixtures__/github.json'
import meta from './__fixtures__/meta.json'
import posts from './__fixtures__/posts.json'
2022-11-19 16:09:13 +01:00
import './__mocks__/matchMedia'
2019-11-24 14:29:25 +01:00
const useStaticQuery = jest.spyOn(Gatsby, 'useStaticQuery')
beforeAll(() => {
useStaticQuery.mockImplementation(() => ({
...meta,
...avatar,
logo: { edges: [{ node: { relativePath: 'apple-touch-icon.png' } }] },
...posts,
...github
}))
})