Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dr3/rtl-debug
https://github.com/dr3/rtl-debug
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/dr3/rtl-debug
- Owner: dr3
- Created: 2018-12-07T16:30:12.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-20T10:09:47.000Z (about 6 years ago)
- Last Synced: 2025-01-14T22:32:38.493Z (10 days ago)
- Language: JavaScript
- Size: 104 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Issue
When using `npm link` to link a dependancy that uses `jest-styled-components` it doesnt return the css generated by styled components.
# What is this repo?
This repo shows the bug, it has 2 examples,
- psammead-headings which links to psammead-test-helpers (which uses `jest-styled-components`),
- psammead-headings-with-test-helpers which has `jest-styled-components` as a dependancy directly
When `psammead-headings` is locally linked to `psammead-test-helpers`, `jest-styled-components` via `react-testing-library` produces a fragment without styles, vs when `psammead-headings-with-test-helpers` uses `react-testing-library` and `jest-styled-components` which does have styles.
# To Replicate issue
Install the top level repo and all child packages
```
npm install
```Link psammead-headings to psammead-test-helpers locally
```
cd packages/psammead-headings && npm link ../psammead-test-helpers && cd ..;
```Build the files and run the test
```
npm run build && npm run test -- -u
```See that the snapshots generated are different, one has css included, one doesnt
`packages/psammead-headings-with-test-helpers/src/__snapshots__/index.test.jsx.snap`
`packages/psammead-headings/src/__snapshots__/index.test.jsx.snap`