Gathering detailed insights and metrics for enzyme-to-json-mock-props
Gathering detailed insights and metrics for enzyme-to-json-mock-props
Gathering detailed insights and metrics for enzyme-to-json-mock-props
Gathering detailed insights and metrics for enzyme-to-json-mock-props
it gives the ability to mock props with enzyme-to-json
npm install enzyme-to-json-mock-props
Typescript
Module System
Node Version
NPM Version
TypeScript (73.92%)
JavaScript (26.08%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
5 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Jun 10, 2019
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
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
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
no SAST tool detected
Details
Reason
Found 0/5 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- 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
56 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