-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjavascript.json
78 lines (78 loc) · 1.48 KB
/
javascript.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
"constructor": {
"prefix": "cons",
"body": [
"constructor(props) {",
"\tsuper(props);",
"\tthis.state = {",
"\t\t$1",
"\t};",
"}"
]
},
"styles": {
"prefix": "styles",
"body": [
"style={styles.$1}"
]
},
"console": {
"prefix": "clg",
"body": [
"console.log(${0})"
]
},
"tron": {
"prefix": "tron",
"body": [
"console.tron.logImportant('===============${0}===============', ${0})"
]
},
"warn": {
"prefix": "warn",
"body": [
"console.warn('===============${0}===============', ${0})"
]
},
"console-labeled": {
"prefix": "cll",
"body": [
"console.log('===============${0}===============', ${0})"
]
},
"snapshot-test": {
"prefix": "snap",
"body": [
"import React from 'react';",
"import { shallow } from 'enzyme';",
"import toJson from 'enzyme-to-json';",
"\n",
"import { ${0} } from './${0}';",
"\n",
"describe('component: ${0}', () => {",
"\tit('matches the snapshot', () => {",
"\t\tconst tree = shallow(<${0} {...props} />);",
"\n",
"\t\texpect(toJson(tree)).toMatchSnapshot();",
"\t});",
"});"
]
},
"jest-test": {
"prefix": "itt",
"body": [
"\tit('${0}', async () => {",
"\t\t//given",
"\t\tconst component = build();",
"\t\tconst expected = ${1};",
"\t\tconst instance = await component.instance();",
"\n",
"\t\t//when",
"\t\tconst result = instance.${2}();",
"\n",
"\t\t//then",
"\t\texpect(result).toEqual(expected);",
"});"
]
}
}