diff --git a/docs/docs/unit-testing.md b/docs/docs/unit-testing.md index 4bda866814d74..533cc55632cb4 100644 --- a/docs/docs/unit-testing.md +++ b/docs/docs/unit-testing.md @@ -132,11 +132,22 @@ const gatsby = jest.requireActual("gatsby") module.exports = { ...gatsby, graphql: jest.fn(), - Link: jest.fn().mockImplementation(({ to, ...rest }) => - React.createElement("a", { - ...rest, - href: to, - }) + Link: jest.fn().mockImplementation( + // these props are invalid for an `a` tag + ({ + activeClassName, + activeStyle, + getProps, + innerRef, + ref, + replace, + to, + ...rest + }) => + React.createElement("a", { + ...rest, + href: to, + }) ), StaticQuery: jest.fn(), useStaticQuery: jest.fn(),