Emotion: Add toHaveStyleRule to jest-emotion

Created on 7 May 2018  路  7Comments  路  Source: emotion-js/emotion

First of all thanks for the library! I've using and enjoying it a lot lately.

I was wondering if there are any plans to add something like toHaveStyleRule to jest-emotion, something similar to what jest-styled-components have: https://github.com/styled-components/jest-styled-components#usage

I'd like to be able to test the output of style generation instead of just matching it against a snapshot.

Thanks!

feature request

All 7 comments

We're not planning on adding it but we'd happily accept a PR adding it!!

Cool! I'll see how I can help with this then 馃槃

@fernandofleury I worked on adding this feature to jest-glamor-react, which jest-emotion is based on. This file should be helpful: https://github.com/kentcdodds/jest-glamor-react/blob/master/src/matchers.js

If you don't get around to it I'd be happy to pick this up

Thanks @danreeves! I'm hoping to pick this during the weekend.

hey @danreeves would you mind picking this one up? 馃憖

Sure thing! I'll try and work it in this week

I believe this is resolved in #662.
Thank you for reporting an issue!

Was this page helpful?
0 / 5 - 0 ratings