Skip to content

Commit 1327ee4

Browse files
committed
Merge branch 'develop'
2 parents 508fa9d + 1f86640 commit 1327ee4

File tree

3 files changed

+38
-9
lines changed

3 files changed

+38
-9
lines changed

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# React Snippets for Visual Studio Code
22

3-
Extension for Visual Studio Code to add snippets for React in ECMA Script 6.
3+
Extension for Visual Studio Code to add snippets for React in ECMAScript 6.
44

55
![Extension demo](./images/snippet-demo.gif)
66

@@ -52,6 +52,8 @@ u-action // Redux action
5252
u-it // Jest test `it`
5353
u-desc // Jest test `describe`
5454
u-suite // Jest test suite (including import statements)
55+
u-afterEach // Jest afterEach function
56+
u-beforeEach // Jest beforeEach function
5557
```
5658

5759
## Installation
@@ -65,3 +67,8 @@ Can also be installed using
6567
```bash
6668
ext install uruit-react-snippets
6769
```
70+
71+
## Troubleshooting
72+
If the snippets prefixes do not show up when typing them, make sure you have the tab-completion enabled in your settings: `"editor.tabCompletion": true`.
73+
74+
Alternatively, you can choose *Insert Snippet* in the Command Palette (`Cmd+Shift+P` on Mac, `Ctrl+Shift+P` on Windows or Linux).

package.json

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
{
22
"name": "uruit-react-snippets",
3-
"displayName": "Uruit React Snippets",
3+
"displayName": "UruIT React Snippets",
44
"description": "React Snippets with ECMAScript 6",
5-
"version": "1.0.1",
5+
"version": "1.1.1",
66
"publisher": "UruIT",
77
"icon": "images/uruit-logo.png",
88
"engines": {
99
"vscode": "^1.13.0"
1010
},
11-
"categories": [
12-
"Snippets"
13-
],
11+
"categories": ["Snippets"],
1412
"homepage": "https://github.com/UruIT/vscode-react-snippets",
1513
"repository": {
1614
"type": "git",

snippets/snippets.json

+27-3
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,39 @@
8888
"import renderer from 'react-test-renderer';",
8989
"import { shallow } from 'enzyme';",
9090
"",
91+
"const PROPS = {",
92+
"\t$0",
93+
"}",
94+
"",
9195
"describe('$1', () => {",
9296
"\tit('should render', () => {",
93-
"\t\tconst wrapper = shallow(<$1 />);",
97+
"\t\tconst wrapper = shallow(<$1 {...PROPS} />);",
9498
"\t\texpect(wrapper.find('div').node).toBeTruthy();",
9599
"\t});",
96100
"});"
97101
],
98102
"description": "Jest Test Suite"
99103
},
104+
"Jest afterEach": {
105+
"prefix": "u-afterEach",
106+
"body": [
107+
"afterEach(() => {",
108+
"\t$1",
109+
"});",
110+
""
111+
],
112+
"description": "Jest afterEach: Runs a function after each one of the tests in this file completes"
113+
},
114+
"Jest beforeEach": {
115+
"prefix": "u-beforeEach",
116+
"body": [
117+
"beforeEach(() => {",
118+
"\t$1",
119+
"});",
120+
""
121+
],
122+
"description": "Jest beforeEach: Runs a function before each of the tests in this file runs"
123+
},
100124
"PropTypes": {
101125
"prefix": "u-pt",
102126
"body": [
@@ -225,7 +249,7 @@
225249
"\t}",
226250
"}"
227251
],
228-
"description": "React PropType Any"
252+
"description": "React custom PropType"
229253
},
230254
"PropTypes.CustomArrayProp": {
231255
"prefix": "u-ptcustomarrayof",
@@ -236,7 +260,7 @@
236260
"\t}",
237261
"})"
238262
],
239-
"description": "React PropType Any"
263+
"description": "React PropType CustomArrayOf"
240264
},
241265
"Redux actions": {
242266
"prefix": "u-actions",

0 commit comments

Comments
 (0)