Skip to content

Commit f029d09

Browse files
Qaiser AbbasQaiser Abbas
Qaiser Abbas
authored and
Qaiser Abbas
committed
enzyme-to-json serializer
1 parent 8280243 commit f029d09

File tree

2 files changed

+19
-67
lines changed

2 files changed

+19
-67
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"devDependencies": {
66
"babel-eslint": "^8.2.3",
7+
"enzyme-to-json": "^3.3.3",
78
"eslint": "^4.9.0",
89
"eslint-config-airbnb": "^16.1.0",
910
"eslint-config-prettier": "^2.9.0",
@@ -28,7 +29,8 @@
2829
},
2930
"jest": {
3031
"preset": "jest-expo",
31-
"setupTestFrameworkScriptFile": "<rootDir>/jestSetup.js"
32+
"setupTestFrameworkScriptFile": "<rootDir>/jestSetup.js",
33+
"snapshotSerializers": ["enzyme-to-json/serializer"]
3234
},
3335
"dependencies": {
3436
"enzyme": "^3.3.0",
Lines changed: 16 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,21 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`renders correctly 1`] = `
4-
ShallowWrapper {
5-
"length": 1,
6-
Symbol(enzyme.__root__): [Circular],
7-
Symbol(enzyme.__unrendered__): <Unknown
8-
text="Sample Text"
9-
/>,
10-
Symbol(enzyme.__renderer__): Object {
11-
"batchedUpdates": [Function],
12-
"getNode": [Function],
13-
"render": [Function],
14-
"simulateEvent": [Function],
15-
"unmount": [Function],
16-
},
17-
Symbol(enzyme.__node__): Object {
18-
"instance": null,
19-
"key": undefined,
20-
"nodeType": "class",
21-
"props": Object {
22-
"accessible": true,
23-
"allowFontScaling": true,
24-
"children": "Sample Text",
25-
"ellipsizeMode": "tail",
26-
"style": Object {
27-
"backgroundColor": "#434343",
28-
"color": "#fff",
29-
"fontSize": 20,
30-
"marginTop": 20,
31-
"padding": 20,
32-
"textAlign": "center",
33-
},
34-
},
35-
"ref": null,
36-
"rendered": "Sample Text",
37-
"type": [Function],
38-
},
39-
Symbol(enzyme.__nodes__): Array [
4+
<Text
5+
accessible={true}
6+
allowFontScaling={true}
7+
ellipsizeMode="tail"
8+
style={
409
Object {
41-
"instance": null,
42-
"key": undefined,
43-
"nodeType": "class",
44-
"props": Object {
45-
"accessible": true,
46-
"allowFontScaling": true,
47-
"children": "Sample Text",
48-
"ellipsizeMode": "tail",
49-
"style": Object {
50-
"backgroundColor": "#434343",
51-
"color": "#fff",
52-
"fontSize": 20,
53-
"marginTop": 20,
54-
"padding": 20,
55-
"textAlign": "center",
56-
},
57-
},
58-
"ref": null,
59-
"rendered": "Sample Text",
60-
"type": [Function],
61-
},
62-
],
63-
Symbol(enzyme.__options__): Object {
64-
"adapter": ReactSixteenAdapter {
65-
"options": Object {
66-
"enableComponentDidUpdateOnSetState": true,
67-
},
68-
},
69-
},
70-
}
10+
"backgroundColor": "#434343",
11+
"color": "#fff",
12+
"fontSize": 20,
13+
"marginTop": 20,
14+
"padding": 20,
15+
"textAlign": "center",
16+
}
17+
}
18+
>
19+
Sample Text
20+
</Text>
7121
`;

0 commit comments

Comments
 (0)