refactor(starter): upgrade and move to typescript

This commit is contained in:
Alexander Shelepenok
2022-04-16 14:25:55 +00:00
parent 67ebabbaac
commit 50a99f57f7
156 changed files with 5350 additions and 7173 deletions

View File

@@ -11,21 +11,19 @@ const mockedStaticQuery = StaticQuery as jest.Mock;
const mockedUseStaticQuery = useStaticQuery as jest.Mock;
describe("IndexTemplate", () => {
const props = {
data: {
...mocks.allMarkdownRemark,
},
...mocks.pageContext,
};
beforeEach(() => {
mockedStaticQuery.mockImplementationOnce(({ render }) =>
render(mocks.siteMetadata),
);
mockedStaticQuery.mockImplementationOnce(({ render }) => render(mocks.siteMetadata));
mockedUseStaticQuery.mockReturnValue(mocks.siteMetadata);
});
it("renders correctly", () => {
const props = {
data: {
allMarkdownRemark: mocks.allMarkdownRemark,
},
pageContext: mocks.pageContext,
};
const tree = renderer.create(<IndexTemplate {...props} />).toJSON();
expect(tree).toMatchSnapshot();
});