我正在测试React应用,并遇到以下错误:TypeError: expect(...).toBeString is not a function
。我正在使用的代码是:
import React from "react";
import { configure, shallow } from "enzyme";
import Adapter from "enzyme-adapter-react-16";
import Footer from "../Footer/Footer";
configure({ adapter: new Adapter() });
describe("<About />", () => {
it("Check the type of value", () => {
const props = {
copyright: "Copyright 2019"
};
const wrapper = shallow(<Footer {...props} />);
expect(wrapper.prop("copyright")).toBeString();
});
});