DEV Community

Discussion on: Configuring Jest and Enzyme in Create React App on Typescript

Collapse
 
vivekk81 profile image
Vivek Kumawat • Edited

Hi Harmon, Thanks for the such a good explanation. I followed your process to enable my App with jest and enzyme. But after running yarn test, all generated spapshot files are empty. They are only having following data:

// Jest Snapshot v1, goo.gl/fbAQLP

exports[App component App rendering: 1] = ShallowWrapper {};

===========================

Following is my App.test.tsx file:

import React from "react";
import App from "../App";
import { MemoryRouter } from "react-router-dom";
import { I18nextProvider } from "react-i18next";
import i18n from "../../i18n";
import { shallow } from "enzyme";

describe("App component", () => {
it("App rendering:", () => {
const hostWrapper = shallow(





);
expect(hostWrapper).toMatchSnapshot();
});
});