Gathering detailed insights and metrics for enzyme-to-json-mock-props
Gathering detailed insights and metrics for enzyme-to-json-mock-props
npm install enzyme-to-json-mock-props
Typescript
Module System
Node Version
NPM Version
51.7
Supply Chain
91.4
Quality
72.7
Maintenance
100
Vulnerability
98.6
License
TypeScript (73.92%)
JavaScript (26.08%)
Total Downloads
1,120
Last Day
4
Last Week
5
Last Month
14
Last Year
102
5 Commits
1 Watching
1 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.0
Package Id
enzyme-to-json-mock-props@1.0.0
Unpacked Size
7.50 kB
Size
3.50 kB
File Count
10
NPM Version
6.9.0
Node Version
10.15.3
Cumulative downloads
Total Downloads
Last day
33.3%
4
Compared to previous day
Last week
0%
5
Compared to previous week
Last month
600%
14
Compared to previous month
Last year
-23.9%
102
Compared to previous year
1
1
it gives you the ability to mock props generated via
enzyme-to-json
.
1npm install enzyme-to-json-mock-props
Assuming you are using enzyme-to-json/serializer
as snapshotSerializers
, example.
1import * as React from "react"; 2import { shallow } from "enzyme"; 3import mockProps from "enzyme-to-json-mock-props"; 4 5const SubComponent = () => <div />; 6 7const Component = props => ( 8 <SubComponent {...props} style={{ background: "red", color: "black" }} /> 9); 10 11describe("my snapshot", () => { 12 const props = { 13 foo: { 14 bar: 123 15 }, 16 foobar: "asd", 17 asd: { 18 qwe: 321 19 } 20 }; 21 it("should render properly", () => { 22 const wrapper = shallow(<Component {...props} />); 23 expect( 24 mockProps(wrapper, ["foo", "foobar", "style", "qwe"]) 25 ).toMatchSnapshot(); 26 }); 27});
before (without mockProps
):
1exports[`enzyme-to-json-mock-props should render properly 1`] = ` 2<SubComponent 3 asd={ 4 Object { 5 "qwe": 321, 6 } 7 } 8 foo={ 9 Object { 10 "bar": 123, 11 } 12 } 13 foobar="asd" 14 style={ 15 Object { 16 "background": "red", 17 "color": "black", 18 } 19 } 20/> 21`;
after (with mockProps
):
1exports[`enzyme-to-json-mock-props should mock the indicated props 1`] = ` 2<SubComponent 3 asd={ 4 Object { 5 "qwe": 321, 6 } 7 } 8 foo="[foo]" 9 foobar="[foobar]" 10 style="[style]" 11/> 12`;
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
Found 0/5 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
54 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-20
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