use local casperjs & update dev setup guide

This commit is contained in:
Evan You 2015-05-27 17:02:30 -04:00
parent 0031c60262
commit 59e00d9393
3 changed files with 8 additions and 10 deletions

View File

@ -44,11 +44,10 @@ Hi! Im really excited that you are interested in contributing to Vue.js. Befo
## Development Setup
You will need [Node](http://nodejs.org), [Grunt](http://gruntjs.com), [PhantomJS](http://phantomjs.org) and [CasperJS](http://casperjs.org).
You will need [Node.js](http://nodejs.org) & [Grunt](http://gruntjs.com).
``` bash
# in case you dont already these:
# npm install -g grunt-cli phantomjs casperjs
# npm install -g grunt-cli
$ npm install
```
@ -61,7 +60,7 @@ $ npm run dev
To lint:
``` bash
grunt jshint
$ grunt jshint
```
To build:
@ -73,13 +72,11 @@ $ grunt build
To test:
``` bash
# if you dont have these yet:
# npm install -g phantomjs casperjs
$ grunt test
```
The unit tests are written with Jasmine and run with Karma. The functional tests are written for and run with CasperJS.
The default task (by simply running `grunt`) will do the following: lint -> build -> unit tests -> e2e tests. It is required to have this pass successfully for a PR to be considered.
**If you are not using a Mac**
The unit tests are written with Jasmine and run with Karma. The e2e tests are written for and run with CasperJS.
You can modify the Gruntfile to only run Karma tests in browsers that are available on your system. Just make sure dont check in the Gruntfile for the commit.
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/yyx990803/vue/blob/dev/gruntfile.js#L42) to only run Karma tests in browsers that are available on your system. Just make sure dont check in the gruntfile changes for the commit.

View File

@ -8,7 +8,7 @@ module.exports = function (grunt) {
var done = this.async()
var file = id ? id + '.js' : ''
grunt.util.spawn({
cmd: 'casperjs',
cmd: '../../node_modules/.bin/casperjs',
args: ['test', '--concise', './' + file],
opts: {
stdio: ['ignore', process.stdout, 'ignore'],

View File

@ -21,6 +21,7 @@
"dev": "webpack --watch --config build/webpack-dev-config.js & webpack --watch --config build/webpack-test-config.js"
},
"devDependencies": {
"casperjs": "^1.1.0-beta3",
"grunt": "^0.4.5",
"grunt-contrib-jshint": "^0.10.0",
"grunt-karma": "^0.8.3",