-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # 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; |
# for free
to join this conversation on GitHub.
Already have an account?
# 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: