enzyme debug 1

enzyme debug

console.log(wrapper.debug());

Here is what the above code is Doing:
1. We’re importing the enzyme library and the shallow function from the enzyme library.
2. We’re importing the React library.
3. We’re importing the component we want to test.
4. We’re creating a wrapper variable that will hold the shallowly rendered component.
5. We’re using the shallow function to shallowly render the component.
6. We’re using the debug function to print out the component’s HTML.

Similar Posts