First include the dependency in your project as dev-dependency.
$ npm i @sfitzpatrick/enzyme-context-helpers -D
$ yarn add @sfitzpatrick/enzyme-context-helpers -D
First you need to
init once to pass your Styled Components theme.
;// Change path to where your Theme is saved;;
Then when you want test your styled components, which are dependent on theme context, you can use the following helpers to test with
mount. These functions will automatically inject the Theme into your components.
;const mountedWrapper = ;const shallowWrapper = ;const snapshotWrapper = ;
- Steven Fitzpatrick @Fitzy_longhorn
This project is licensed under the MIT License - see the Licence.md file for details.
📜 Change log
The change log can found on the CHANGELOG page.
Feel free to contribute and submit pull requests.test