1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-27 04:10:03 +01:00
blog/jest/__mocks__/gatsby.js

30 lines
552 B
JavaScript
Raw Normal View History

2019-11-24 14:29:25 +01:00
/* eslint-disable no-unused-vars */
const React = require('react')
const gatsby = jest.requireActual('gatsby')
module.exports = {
...gatsby,
graphql: jest.fn(),
Link: jest.fn().mockImplementation(
// these props are invalid for an `a` tag
({
activeClassName,
activeStyle,
getProps,
innerRef,
partiallyActive,
ref,
replace,
to,
...rest
}) =>
React.createElement('a', {
...rest,
href: to
})
),
StaticQuery: jest.fn(),
useStaticQuery: jest.fn()
}