Files
unicorn-utterances/__mocks__/modules/gatsby-plugin-google-analytics.tsx
2021-02-11 09:55:45 -08:00

20 lines
393 B
TypeScript

import { onLinkClick } from "gatsby-plugin-google-analytics";
afterEach(() => {
onLinkClick.mockReset();
});
jest.mock("gatsby-plugin-google-analytics", () => {
const React = require("react");
const onLinkClickFn = jest.fn();
return {
OutboundLink: (props: any) => (
<div onClick={onLinkClickFn}>{props.children}</div>
),
onLinkClick: onLinkClickFn
};
});
export default {};