1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-12-23 09:45:56 +01:00
blog/jest/__mocks__/gatsby.ts

15 lines
308 B
TypeScript
Raw Normal View History

2019-10-11 23:50:03 +02:00
import React from 'react'
2019-05-02 21:11:52 +02:00
const gatsby = jest.requireActual('gatsby')
2019-10-11 23:50:03 +02:00
export default {
2019-05-02 21:11:52 +02:00
...gatsby,
graphql: jest.fn(),
2019-10-13 19:08:36 +02:00
Link: jest
.fn()
.mockImplementation(({ to, ...rest }) =>
React.createElement('a', { ...rest, href: to })
),
2019-05-02 21:11:52 +02:00
StaticQuery: jest.fn(),
useStaticQuery: jest.fn()
}