-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working correctly with @testing-library/react #425
Comments
Who error? |
I also cannot get this working... consistently get a variation of this error:
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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to use this library with @testing-library/react and can't make it work properly. I changed package versions, looked on other github repositories and impossible to find a working example. (Does anyone has a working repo to show ?)
package.json
test file
snapshot:
jest.config.js
cssTransform.js
The text was updated successfully, but these errors were encountered: