Getting Started
1) Install
Enzyme Context has peer dependencies on react
and enzyme
. Make sure they are installed and set up correctly before proceeding.
Enzyme Context loves yarn
:
But npm
is fine too:
2) Create mount() and shallow()
At TrialSpark, we do this in a module called test-utils/enzyme
, but you can put yours wherever you like:
3) Use the mount/shallow we just created in place of enzyme's
4) Add some plugins!
The mount
/shallow
we created in step two doesn't really do anything that enzyme doesn't already do out-of-the-box. The next thing you should do is install some plugins.
Last updated