-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypescript.json
88 lines (88 loc) · 2.07 KB
/
typescript.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
79
80
81
82
83
84
85
86
87
88
{
"iife": {
"prefix": "iife",
"body": ["(() => {", "", "})()"],
"description": "Immediatly Invoked Function Expression"
},
"End-to-end Page Model": {
"prefix": "e2e-page-model",
"body": [
"const model = () => {",
"",
" return {",
"",
" }",
"}",
"",
"export default model;"
],
"description": "Jest short test"
},
"1-arity function": {
"prefix": "function-arity-1",
"body": ["const ${1:functionName} = (): ${2:ReturnType} => "],
"description": "Function of arity 1"
},
"Jest describe": {
"prefix": "jest-describe",
"body": ["describe(\"\", () => {", " ", "});"],
"description": "Jest describe"
},
"Jest test": {
"prefix": "jest-test",
"body": [
"test(\"\", () => {",
" // Given",
" ",
" // When",
" const actual = ${1:functionUnderTest}();",
" ",
" // Then",
" const expected: ${2:number} = 0;",
" expect(actual).toEqual(expected);",
"});"
],
"description": "Jest test"
},
"Jest short test": {
"prefix": "jest-test-short",
"body": [
"test(\"\", () => {",
" expect(${1:functionUnderTest}()).toEqual(${2:expected});",
"});"
],
"description": "Jest short test"
},
"Jest property-based testing": {
"prefix": "jest-test-pbt",
"body": [
"test(\"\", () => {",
" fc.assert(",
" fc.property(fc.record({ a: fc.nat(), b: fc.nat() }), ({ a, b }) => {",
" fc.pre(a < b);",
" return true;",
" })",
" );",
"});"
],
"description": "Jest test"
},
"Jest full": {
"prefix": "jest-describe-and-test",
"body": [
"describe(\"\", () => {",
" test(\"\", () => {",
" // Given",
" ",
" // When",
" const actual = ${1:functionUnderTest}();",
" ",
" // Then",
" const expected: ${2:number} = 0;",
" expect(actual).toEqual(expected);",
" });",
"});"
],
"description": "Jest describe and test"
}
}