[React Native] Jest matchers for styled-components
Motivation
Add a way to check if styled-component has a style rule (or style rule has a right value)
Installation
yarn add jest-styled-components-matcher --dev
or
npm i jest-styled-components-matcher -D
Usage
Just import it in the place you're going to use it:
That's it! Now you can use it in your tests:
;
Assertation messages
-
Wrong value
-
Missing rule