How to use the gatsby.useStaticQuery.mockImplementationOnce function in gatsby

To help you get started, we’ve selected a few gatsby examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ravanscafi / ravan.me / src / components / __tests__ / bio.js View on Github external
beforeEach(() => {
  useStaticQuery.mockImplementationOnce(() => ({
    avatar: {
      childImageSharp: {
        fixed: {
          base64: "data:image/jpeg;base64,/9j/SHAcv//Z",
          width: 150,
          height: 150,
          src: "/static/src/profile-pic.jpg",
          srcSet: "/static/srcset/profile-pic.jpg",
        },
      },
    },
    site: {
      siteMetadata: {
        author: "Ravan Scafi",
        social: {
          twitter: "ravanscafi",
github ravanscafi / ravan.me / src / components / __tests__ / layout.js View on Github external
beforeEach(() => {
  useStaticQuery.mockImplementationOnce(() => ({
    site: {
      siteMetadata: {
        repository: { name: "Gitlab", url: "gitlab.com" },
        title: "My Site",
      },
    },
  }))
})