1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-15 09:35:21 +01:00
blog/jest/setup-test-env.ts

19 lines
557 B
TypeScript
Raw Normal View History

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