Skip to content

Commit ee456f1

Browse files
committed
update contributing guide
1 parent 2358403 commit ee456f1

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

CONTRIBUTING.md

+20-7
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@ Hi! I’m really excited that you are interested in contributing to Vue.js. Befo
3939
## Code Style
4040

4141
- [No semicolons unless necessary](http://inimino.org/~inimino/blog/javascript_semicolons).
42+
4243
- Follow JSDoc.
44+
4345
- 2 spaces indentation.
46+
4447
- multiple var declarations.
45-
- align equal signs where appropriate.
46-
- Return early.
47-
- 1 space after `function`
48+
49+
- 1 space after `function` and function names.
50+
4851
- 1 space between arguments, but not between parentheses.
49-
- When in doubt, read the source code.
52+
5053
- Break long ternary conditionals like this:
5154

5255
``` js
@@ -55,6 +58,8 @@ Hi! I’m really excited that you are interested in contributing to Vue.js. Befo
5558
: 'nope'
5659
```
5760

61+
- When in doubt, read the source code.
62+
5863
## Development Setup
5964

6065
You will need [Node.js](http://nodejs.org) & [Grunt](http://gruntjs.com).
@@ -66,12 +71,18 @@ $ npm install
6671
$ npm run install-hook
6772
```
6873

69-
To watch and auto-build `dist/vue.js` during development:
74+
Dev mode: watch and auto-build `dist/vue.js` and unit tests during development:
7075

7176
``` bash
7277
$ npm run dev
7378
```
7479

80+
The unit tests can be run in a browser by opening `test/unit/runner.html`. Make sure you are running dev mode first. There's a shortcut grunt task for opening the unit test page:
81+
82+
``` bash
83+
$ grunt open
84+
```
85+
7586
To lint:
7687

7788
``` bash
@@ -84,7 +95,7 @@ To build:
8495
$ grunt build
8596
```
8697

87-
To test:
98+
Run full test suite (see browser notes below):
8899

89100
``` bash
90101
$ grunt test
@@ -94,4 +105,6 @@ The default task (by simply running `grunt`) will do the following: lint -> buil
94105

95106
The unit tests are written with Jasmine and run with Karma. The e2e tests are written for and run with CasperJS.
96107

97-
Note that the unit tests will automatically be run in Chrome, Firefox and Safari. If you are not on a Mac, or don't have one of the browsers installed on your system, you can modify the [karma config in gruntfile.js](https://github.com/vuejs/vue/blob/dev/gruntfile.js#L38) to only run Karma tests in browsers that are available on your system. Just make sure don’t check in the gruntfile changes for the commit.
108+
### Test Browser Notes
109+
110+
When running the default `grunt` task, the unit tests will automatically be run in Chrome, Firefox and Safari. If you are not on a Mac, or don't have one of the browsers installed on your system, you can modify the [karma config in gruntfile.js](https://github.com/vuejs/vue/blob/dev/gruntfile.js#L38) to only run Karma tests in browsers that are available on your system. Just make sure don’t check in the gruntfile changes for the commit.

0 commit comments

Comments
 (0)