You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What you did:
I have two repositories, one that contains a UI library using glamour and the other that contains our production site, also using glamor. Both are using the same version of jest-glamor-react. In our main repo, when we have the UI library installed normally, we see the styles come through on all components, and all is well. But when running npm link to symlink to a local copy of the UI library, components from that library no longer get transformed, and we just get data-css-hash in our snapshots for those components.
Clone both and link client -> library (the dependency in client is expecting it to be called library) and the tests pass. But looking at the snapshots for the client, the test that depends on the library component doesn't include the styles.
Problem description:
Snapshots are not transforming css classes when the component exists in a locally linked repo.
Suggested solution:
Treat locally linked libraries the same way as locally installed ones and transform the styles on that repo.
The text was updated successfully, but these errors were encountered:
My guess is that you have two instances of the glamor module loaded in your tests. This isn't really something we can solve in this library I'm afraid. You'll have to make sure that the glamor your components are using I'd the same one this library if using.
Thanks for the reply - what you say makes sense, and would explain this. Also agree it's probably not on this library to solve, and is part of the way npm handles dependencies. I'm not seeing a good way around it either at the moment which is a real shame. Thanks for your time at any rate.
I've updated the comment above to include the repos as I'd managed to pull them together, in case it's useful to anyone else.
jest-glamor-react
version: 4.3.1node
version: 9.11.2npm
(oryarn
) version: 6.1.0What you did:
I have two repositories, one that contains a UI library using glamour and the other that contains our production site, also using glamor. Both are using the same version of jest-glamor-react. In our main repo, when we have the UI library installed normally, we see the styles come through on all components, and all is well. But when running npm link to symlink to a local copy of the UI library, components from that library no longer get transformed, and we just get data-css-hash in our snapshots for those components.
Reproduction repository:
https://github.com/chrissinclairedited/jest-glamor-react-issue-library
https://github.com/chrissinclairedited/jest-glamor-react-issue-client
Clone both and link client -> library (the dependency in client is expecting it to be called library) and the tests pass. But looking at the snapshots for the client, the test that depends on the library component doesn't include the styles.
Problem description:
Snapshots are not transforming css classes when the component exists in a locally linked repo.
Suggested solution:
Treat locally linked libraries the same way as locally installed ones and transform the styles on that repo.
The text was updated successfully, but these errors were encountered: