Gathering detailed insights and metrics for jest-fela-react
Gathering detailed insights and metrics for jest-fela-react
Gathering detailed insights and metrics for jest-fela-react
Gathering detailed insights and metrics for jest-fela-react
npm install jest-fela-react
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
3 Stars
8 Commits
1 Forks
3 Watchers
1 Branches
2 Contributors
Updated on Dec 04, 2021
Latest Version
0.2.0
Package Id
jest-fela-react@0.2.0
Size
3.83 kB
NPM Version
5.3.0
Node Version
8.3.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
3
29
Jest snapshots are amazing, but with fela, you'll get pretty ugly snapshots with classNames that don't have any meaning. However, by adding jest-fela-react
to Jest, you can get snapshots diffs where you can understand the changed content.
If you use fela
as your CSS-in-JS solution, and you use
[snapshot testing][snapshot] with [jest][jest] then you probably have some test
snapshots that look like:
1<div 2 className="fovk07z" 3> 4 <div 5 className="f16lnj6g" 6 > 7 Hello World 8 </div> 9</div>
1.fovk07z> div { 2 font-weight: 500; 3} 4 5.fovk07z { 6 border: solid 1px black; 7} 8 9.f16lnj6g { 10 color: red; 11 font-size: 16px; 12} 13 14<div 15 className="fovk07z" 16> 17 <div 18 className="f16lnj6g" 19 > 20 Hello World 21 </div> 22</div>
Kent C. Dodds published jest-glamor-react
, which does the same thing as jest-fela-react
, but for glamor
. He himself took inspiration from Michele Bertoli who worked on jest-styled-components
, an equivalent for styled-component
. Most of the code in this repo is actually taken from these two projects, since there is little difference between snapshotting for fela and for these other css in js solution. And because they are much better than I am, so they did a better job than I would have! All I did was make it compatible with fela.
yarn -D jest-glamor-react
At the top of your test file:
1import createSerializer from 'jest-fela-react' 2import {createRenderer} from 'fela'; 3import monolithic from 'fela-monolithic'; 4 5const felaRenderer = createRenderer({ 6 enhancers: [monolithic()] 7}) 8 9expect.addSnapshotSerializer(createSerializer(felaRenderer)) 10 11// You're free to write your tests as you wish
Using fela-monolithic
is not necessary, however, if you skip this part, you'll end up with one class for each property, which I think is less optimal when simply looking for differences between styles.
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/8 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
78 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More