StackOverflow - unit-testing, reactjs, enzyme, airbnb-js-styleguide
Why does shallow Rendering not work as expected?
Use ().toEqual() instead of .to.have.length() as .to.have is not any function in jest expect library Visit here for more info import React from "react"; import TestUser from "./testuser"; import { shallow } from "enzyme"; it("should render right", () => { const component = shallow( ); expect(component.find('Card').length).toEqual(3); });
Was this helpful?
Related Articles
Have a different question?
Can't find the answer you're looking for? Submit your own question to our community.
🛎️ Get Weekly OTA Fixes
New answers, vendor issues, and updates — straight to your inbox.