Comments (3)
Who error?
from jest-styled-components.
I also cannot get this working...
consistently get a variation of this error:
● Test suite failed to run
Cannot create styled-component for component: undefined.
4 | import "jest-styled-components";
5 |
> 6 | const Card = styled.View`
| ^
7 | display: flex;
8 | `;
9 |
Super basic setup:
import { render, screen } from "@src/test-utils/test-utils";
import styled from "styled-components/native";
import "jest-styled-components";
const Card = styled.View`
display: flex;
`;
describe("Card", () => {
it("should render", () => {
const tree = render(<Card />).toJSON();
expect(tree).toMatchSnapshot();
});
});
from jest-styled-components.
I also cannot get this working...
consistently get a variation of this error:
● Test suite failed to run Cannot create styled-component for component: undefined. 4 | import "jest-styled-components"; 5 | > 6 | const Card = styled.View` | ^ 7 | display: flex; 8 | `; 9 |
Super basic setup:
import { render, screen } from "@src/test-utils/test-utils"; import styled from "styled-components/native"; import "jest-styled-components"; const Card = styled.View` display: flex; `; describe("Card", () => { it("should render", () => { const tree = render(<Card />).toJSON(); expect(tree).toMatchSnapshot(); }); });
Try to use this structure with the styled component exported from a variable
import * as styledComponents from "styled-components/native";
import * as theme from "./theme";
import * as themeConstants from "./themeConstants";
import * as darkTheme from "./darkTheme";
export { theme };
export { darkTheme };
export { theme as standard };
export { themeConstants };
const { default: styled, css, ThemeProvider } = styledComponents;
export { css, ThemeProvider };
export default styled;
from jest-styled-components.
Related Issues (20)
- jest-styled-components uses global.beforeEach rather than global.beforeAll or both? HOT 2
- getHTML() is failing, not sure why. HOT 1
- toHaveStyleRule is not compatible with some displayNames if fileName is used
- Child component className value regression from 7.0.7 to 7.0.8 HOT 2
- `setStyleSheetSerializerOptions` types not working HOT 1
- Create wrapper matcher around .toHaveStyleRule
- Doesn't seem to support Jest 28.x.x HOT 6
- [Bug] wrong className generated
- tabs vs spaces
- [Bug] Chained selectors with pseudo-state filters are parsed incorrectly in v7.1.1 HOT 1
- More diffs showing on unchanged snapshot lines
- Dft
- Library is not applied to tests where the Renderer object was created in a 'describe'
- Doesn't seem to support Jest 28 and newest HOT 8
- toHaveStyleRule with @media rule breaks after styled-components update HOT 6
- TypeError: global.beforeEach is not a function HOT 6
- update adobe/css-tools to v4.3.2 due CVE-2023-48631
- Compatibility Issue with `jest-styled-components` and Storybook's `test-runner`
- TypeError: document.querySelectorAll is not a function
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jest-styled-components.