1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-06-30 05:31:44 +02:00
portfolio/jest/setup-test-env.js

21 lines
593 B
JavaScript
Raw Normal View History

2019-07-08 18:29:29 +02:00
import '@testing-library/jest-dom/extend-expect'
2019-04-16 21:21:01 +02:00
import 'jest-canvas-mock'
2019-11-13 14:08:57 +01:00
import { StaticQuery, useStaticQuery } from 'gatsby'
import meta from './__fixtures__/meta.json'
import resume from './__fixtures__/resume.json'
2019-11-25 13:46:44 +01:00
import projects from './__fixtures__/projects.json'
2019-11-13 14:08:57 +01:00
beforeAll(() => {
const photoSrc = resume.contentJson.basics.picture.childImageSharp.fixed.src
const dataMock = {
...meta,
...resume,
photoSrc,
2019-11-25 13:46:44 +01:00
...projects
2019-11-13 14:08:57 +01:00
}
StaticQuery.mockImplementation(({ render }) => render({ ...dataMock }))
2019-11-25 13:46:44 +01:00
useStaticQuery.mockImplementation(() => ({ ...dataMock }))
2019-11-13 14:08:57 +01:00
})