gatsby.js 462 B

1234567891011121314151617
  1. const React = require('react');
  2. const gatsby = jest.requireActual('gatsby');
  3. module.exports = {
  4. ...gatsby,
  5. graphql: jest.fn(),
  6. Link: jest.fn().mockImplementation(
  7. // these props are invalid for an `a` tag
  8. ({ activeClassName, activeStyle, getProps, innerRef, partiallyActive, ref, replace, to, ...rest }) =>
  9. React.createElement('a', {
  10. ...rest,
  11. href: to,
  12. })
  13. ),
  14. StaticQuery: jest.fn(),
  15. useStaticQuery: jest.fn(),
  16. };