jest-styled-components
jest-styled-components copied to clipboard
🔧 💅 Jest utilities for Styled Components
This is probably more a question than an issue... jest-styled-components uses [global.beforeEach](https://github.com/JeromeGill/jest-styled-components/blob/main/src/index.js#L5) to reset stylesheets which means in situations where you don't want to remount a component for every test...
I am having the same issue as described in [Issue#89](https://github.com/styled-components/jest-styled-components/issues/89) the value is correct but somehow the styled-components remove all spaces in the value and does not get strictly compared...
Is this library supposed to work with [snapshot-diff](https://www.npmjs.com/package/snapshot-diff)? I see different class output when using it like this: ``` import 'jest-styled-components' import { render } from 'react-testing-library' import snapshotDiff from...
Hi 👋 I maintain a small library that allows specific customizations to styled-components. I found that testing those styles is becoming too repetitive since on every test file I have...
```jsx const Button = styled.button` @media (max-width: 640px) { &:hover { color: red; } } ` ``` ```jsx test('it works', () => { const tree = renderer.create().toJSON() expect(tree).toHaveStyleRule('color', 'red', {...
``` error TS7016: Could not find a declaration file for module 'jest-styled-components/serializer'. '/Users/yadayadayada/node_modules/jest-styled-components/serializer/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest-styled-components` if it exists or add a new...
The style extraction methods in `src/styleSheetSerializer.js` should extract the styles created by "global styled components" such as created by the [`createGlobalStyle` API](https://styled-components.com/docs/api#createglobalstyle). Currently, this does not happen. Adapting an example...
using: `import "jest-styled-components/native";` message: Property 'toHaveStylerule' does not exist on type 'Matchers'
I keep getting: > No style rules found on passed Component I have been able to trace it to this line: https://github.com/styled-components/jest-styled-components/blob/4b07fde2607516db407a6215d17dfb461b90b491/src/utils.js#L25 ```javascript const getHTML = () => (isServer() ?...
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...