В шутку, в чем разница между использованием мелкого и рендера от фермента?
Вот пример обоих:
Тест рендеринга с мелкой:
import "jest";
import * as React from "react";
import { shallow } from "enzyme";
import Item from "../item.component";
describe("Item", () => {
it("renders correct", () => {
const item = {
name: "A"
};
const component = shallow(
<Item item={item}/>
);
expect(component).toMatchSnapshot();
});
});
Тестовый рендеринг с рендером
import "jest";
import * as React from "react";
import { render } from "enzyme";
import Item from "../item.component";
describe("Item", () => {
it("renders correct", () => {
const item = {
name: "A"
};
const component = render(
<Item item={item}/>
);
expect(component).toMatchSnapshot();
});
});
Какое типичное использование этих 2. Я написал все свои тесты с мелкой, я должен вернуться и изменить это для рендеринга в некоторых случаях?