jest-styled-components
jest-styled-components copied to clipboard
Abstract getStyleRule
This PR attempts to fix https://github.com/styled-components/jest-styled-components/issues/117.
@MicheleBertoli I was not sure how you would want this utility to be exported. To stop it being run when calling import 'jest-styled-components' we could export it from its own file i.e. import getStyleRule from 'jest-styled-components/getStyleRule', but it's less intuitive for users.
Let me know what you think. Thanks.
Thank you very much for working on this, @joebourne. This looks good to me.
What about import {getStyleRule} from 'jest-styled-components/utils'?
No problem, and thanks for reviewing @MicheleBertoli.
I've fixed up the import now.
Hey @Joebourne, thank you very much for your update.
I believe you need to create a "utils" folder which points to the function (see "native").
Otherwise this would be accessible via jest-styled-components/src/utils, right?
Ah yes sorry @MicheleBertoli, the import is now coming from a new utils directory at the root level.
Hi @MicheleBertoli, can I get an update on this please? Is there anything else you want fixing up?
@Joebourne if you wouldn't mind getting this fixed up against the new 7.x beta code I'd be interested to include the new functionality in 7.0 final :)
@probablyup great! I've just fixed it up if you could take another look. Thanks.