Skip to content

Commit 7c4ece0

Browse files
committed
Adding Jest snippet
1 parent b23bc33 commit 7c4ece0

File tree

4 files changed

+31
-17
lines changed

4 files changed

+31
-17
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
* e-ntbd (expect not toBeDefined)
2525
* e-tbu (expect toBeUndefined)
2626
* e-ntbu (expect not toBeUndefined)
27+
28+
* Jest Testing
29+
* e-tms (expect toMatchSnapshot)
2730

2831
## 6.1.0
2932
* RxJS

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ You don't need to type any dashes: "ngrxr" -> "ng-rx-reducer" snippet
8888
| e-tbu | Expect toBe Undefined |
8989
| e-tm | Expect toMatch |
9090
| e-tmr | Expect toMatch regex |
91+
| e-tms | Jest Expect toMatchSnapshot |
9192
| fx-col | Flex Layout Column |
9293
| fx-col-element | Flex Layout Column with Element |
9394
| fx-col-reverse | Flex Layout Reverse Column |

snippets/typescript.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/snippets.json

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2426,7 +2426,7 @@
24262426
"description": "Expect toBe",
24272427
"types": "typescript",
24282428
"body": [
2429-
"expect($2).toBe($3);",
2429+
"expect($1).toBe($1);",
24302430
"$0"
24312431
]
24322432
},
@@ -2435,7 +2435,7 @@
24352435
"description": "Expect Not toBe",
24362436
"types": "typescript",
24372437
"body": [
2438-
"expect($2).not.toBe($3);",
2438+
"expect($1).not.toBe($2);",
24392439
"$0"
24402440
]
24412441
},
@@ -2444,7 +2444,7 @@
24442444
"description": "Expect toBe Falsy",
24452445
"types": "typescript",
24462446
"body": [
2447-
"expect($2).toBeFalsy();",
2447+
"expect($1).toBeFalsy();",
24482448
"$0"
24492449
]
24502450
},
@@ -2453,7 +2453,7 @@
24532453
"description": "Expect not toBe Falsy",
24542454
"types": "typescript",
24552455
"body": [
2456-
"expect($2).not.toBeFalsy();",
2456+
"expect($1).not.toBeFalsy();",
24572457
"$0"
24582458
]
24592459
},
@@ -2462,7 +2462,7 @@
24622462
"description": "Expect toBe Truthy",
24632463
"types": "typescript",
24642464
"body": [
2465-
"expect($2).toBeTruthy();",
2465+
"expect($1).toBeTruthy();",
24662466
"$0"
24672467
]
24682468
},
@@ -2471,7 +2471,7 @@
24712471
"description": "Expect not toBe Truthy",
24722472
"types": "typescript",
24732473
"body": [
2474-
"expect($2).not.toBeTruthy();",
2474+
"expect($1).not.toBeTruthy();",
24752475
"$0"
24762476
]
24772477
},
@@ -2480,7 +2480,7 @@
24802480
"description": "Expect toBe Defined",
24812481
"types": "typescript",
24822482
"body": [
2483-
"expect($2).toBeDefined();",
2483+
"expect($1).toBeDefined();",
24842484
"$0"
24852485
]
24862486
},
@@ -2489,7 +2489,7 @@
24892489
"description": "Expect not toBe Defined",
24902490
"types": "typescript",
24912491
"body": [
2492-
"expect($2).not.toBeDefined();",
2492+
"expect($1).not.toBeDefined();",
24932493
"$0"
24942494
]
24952495
},
@@ -2498,7 +2498,7 @@
24982498
"description": "Expect toBe Undefined",
24992499
"types": "typescript",
25002500
"body": [
2501-
"expect($2).toBeUndefined();",
2501+
"expect($1).toBeUndefined();",
25022502
"$0"
25032503
]
25042504
},
@@ -2507,7 +2507,7 @@
25072507
"description": "Expect not toBe Undefined",
25082508
"types": "typescript",
25092509
"body": [
2510-
"expect($2).not.toBeUndefined();",
2510+
"expect($1).not.toBeUndefined();",
25112511
"$0"
25122512
]
25132513
},
@@ -2516,7 +2516,7 @@
25162516
"description": "Expect toMatch",
25172517
"types": "typescript",
25182518
"body": [
2519-
"expect($2).toMatch(\"$3\");",
2519+
"expect($1).toMatch(\"$2\");",
25202520
"$0"
25212521
]
25222522
},
@@ -2525,7 +2525,7 @@
25252525
"description": "Expect Not toMatch",
25262526
"types": "typescript",
25272527
"body": [
2528-
"expect($2).not.toMatch(\"$3\");",
2528+
"expect($1).not.toMatch(\"$2\");",
25292529
"$0"
25302530
]
25312531
},
@@ -2534,7 +2534,7 @@
25342534
"description": "Expect toMatch regex",
25352535
"types": "typescript",
25362536
"body": [
2537-
"expect($2).toMatch(\\$3\\);",
2537+
"expect($1).toMatch(\\$2\\);",
25382538
"$0"
25392539
]
25402540
},
@@ -2543,7 +2543,7 @@
25432543
"description": "Expect Not toMatch regex",
25442544
"types": "typescript",
25452545
"body": [
2546-
"expect($2).not.toMatch(\\$3\\);",
2546+
"expect($1).not.toMatch(\\$2\\);",
25472547
"$0"
25482548
]
25492549
},
@@ -2552,7 +2552,7 @@
25522552
"description": "Expect toBeNull",
25532553
"types": "typescript",
25542554
"body": [
2555-
"expect($2).toBeNull();",
2555+
"expect($1).toBeNull();",
25562556
"$0"
25572557
]
25582558
},
@@ -2561,10 +2561,20 @@
25612561
"description": "Expect Not toBeNull",
25622562
"types": "typescript",
25632563
"body": [
2564-
"expect($2).not.toBeNull();",
2564+
"expect($1).not.toBeNull();",
25652565
"$0"
25662566
]
25672567
},
2568+
"Jest Test Expect toMatchSnapshot": {
2569+
"prefix": "e-tms",
2570+
"description": "Jest Expect toMatchSnapshot",
2571+
"types": "typescript",
2572+
"body": [
2573+
"expect($1).toMatchSnapshot();",
2574+
"$0"
2575+
]
2576+
},
2577+
25682578
"Angular Http Interceptor": {
25692579
"prefix": "ng-http-interceptor",
25702580
"description": "Intercept an outgoing HttpRequest and optionally transform it or the response.",

0 commit comments

Comments
 (0)