jest-styled-components icon indicating copy to clipboard operation
jest-styled-components copied to clipboard

Abstract getStyleRule

Open joebourne opened this issue 6 years ago • 7 comments

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.

joebourne avatar Nov 30 '18 15:11 joebourne

Thank you very much for working on this, @joebourne. This looks good to me.

What about import {getStyleRule} from 'jest-styled-components/utils'?

MicheleBertoli avatar Dec 08 '18 08:12 MicheleBertoli

No problem, and thanks for reviewing @MicheleBertoli.

I've fixed up the import now.

joebourne avatar Dec 08 '18 13:12 joebourne

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?

MicheleBertoli avatar Dec 16 '18 07:12 MicheleBertoli

Ah yes sorry @MicheleBertoli, the import is now coming from a new utils directory at the root level.

joebourne avatar Dec 21 '18 15:12 joebourne

Hi @MicheleBertoli, can I get an update on this please? Is there anything else you want fixing up?

joebourne avatar Feb 22 '19 12:02 joebourne

@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 :)

quantizor avatar Jun 17 '19 04:06 quantizor

@probablyup great! I've just fixed it up if you could take another look. Thanks.

joebourne avatar Jun 19 '19 07:06 joebourne