2020-05-07 08:03:30 +02:00
|
|
|
import '@testing-library/jest-dom/extend-expect'
|
2020-06-30 19:38:02 +02:00
|
|
|
import * as Gatsby from 'gatsby'
|
|
|
|
import siteMetadata from './__fixtures__/siteMetadata.json'
|
2020-05-07 08:03:30 +02:00
|
|
|
|
2020-06-30 11:28:49 +02:00
|
|
|
if (typeof window.IntersectionObserver === 'undefined') {
|
|
|
|
import('intersection-observer')
|
|
|
|
}
|
|
|
|
|
2020-06-30 19:38:02 +02:00
|
|
|
import('./__mocks__/matchMedia')
|
|
|
|
|
|
|
|
const useStaticQuery = jest.spyOn(Gatsby, 'useStaticQuery')
|
|
|
|
// const useWeb3 = jest.spyOn(oceanReact, 'useWeb3')
|
|
|
|
// const useOcean = jest.spyOn(oceanReact, 'useOcean')
|
|
|
|
|
|
|
|
export const globalMock = {
|
|
|
|
...siteMetadata
|
|
|
|
}
|
|
|
|
|
2020-05-07 08:03:30 +02:00
|
|
|
beforeAll(() => {
|
|
|
|
jest.mock('web3')
|
2020-09-23 11:21:04 +02:00
|
|
|
jest.mock('@oceanprotocol/lib')
|
2020-06-30 19:38:02 +02:00
|
|
|
|
|
|
|
// useOcean.mockImplementation(() => mockReact.useOcean())
|
|
|
|
useStaticQuery.mockImplementation(() => globalMock)
|
2020-05-07 08:03:30 +02:00
|
|
|
})
|