【发布时间】:2018-09-23 13:15:56
【问题描述】:
我正在尝试使用 enzyme 测试我的组件。您能告诉我为什么我收到错误 "Cannot read property 'have' of undefined
"
这是我的代码
https://codesandbox.io/s/oq7kwzrnj5
import React from "react";
import { shallow, mount } from "enzyme";
import Counter from "./Counter";
describe("counter", () => {
it("test truty", () => {
const wrapper = shallow(<Counter />);
expect(wrapper.find("p")).to.have.length(1);
});
});
【问题讨论】:
-
你使用什么测试框架?
-
开个玩笑,没看到例子
标签: reactjs react-redux jestjs enzyme