mirror of
https://github.com/alrayyes/my-opinionated-gatsby-starter
synced 2023-11-14 15:56:29 +00:00
29 lines
580 B
TypeScript
29 lines
580 B
TypeScript
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||
|
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(),
|
||
|
}
|