Skip to content

Commit 6102ea0

Browse files
bernardodomingues-hotmartDamian Sznajder
authored and
Damian Sznajder
committed
Add asynchronous test blocks
I use the `tit` snipped a lot, but whenever I have async tests, I sometimes forget to add the `async` keyword before the arrow function. It would be great if there were snippets that cover this use case. This PR adds two new snippets the create asynchronous tests: * `testa` -> Creates a `test('should ', async () => {})` block * `tita` -> Creates an `it('should ', async () => {})` block
1 parent 78bdce5 commit 6102ea0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

snippets/snippets.json

+10
Original file line numberDiff line numberDiff line change
@@ -1234,11 +1234,21 @@
12341234
"body": ["test('should $1', () => {", "\t$0", "})", ""],
12351235
"description": "Testing `test` block"
12361236
},
1237+
"testAsyncBlock": {
1238+
"prefix": "testa",
1239+
"body": ["test('should $1', async () => {", "\t$0", "})", ""],
1240+
"description": "Testing `asynchronous test` block"
1241+
},
12371242
"itBlock": {
12381243
"prefix": "tit",
12391244
"body": ["it('should $1', () => {", "\t$0", "})", ""],
12401245
"description": "Testing `it` block"
12411246
},
1247+
"itAsyncBlock": {
1248+
"prefix": "tita",
1249+
"body": ["it('should $1', async () => {", "\t$0", "})", ""],
1250+
"description": "Testing asynchronous `it` block"
1251+
},
12421252
"setupReactTest": {
12431253
"prefix": "stest",
12441254
"body": [

0 commit comments

Comments
 (0)