0

I already ran the command npm install --save-dev @ wojtekmaj / enzyme-adapter-react-17 in my project.

Put this in my setupTests.js file:

import Enzyme from 'enzyme';
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';

Enzyme.configure({ adapter: new Adapter() });

And when I start running the tests I get the error.

This is my test file:

PrimeraApp.test.js

import React from "react";
import PrimeraApp from "../PrimeraApp";
import { shallow } from "enzyme";

describe("PrimeraApp.js", () => {
  test("Debe mostrar <PrimeraApp /> correctamente", () => {
    const saludo = "Hola mundo";
    const wrapper = shallow(<PrimeraApp saludo={saludo} />);

    expect(wrapper).toMatchSnapshot();
  });
});

If you can help me, Thank you.

1 Answers1

0

You have to install enzyme package as well. npm i --save enzyme

  • 1
    You probably want `--save-dev` rather than `--save` for a testing library. See https://stackoverflow.com/questions/22891211/ – ptmalcolm Mar 14 '22 at 12:55