metaskills/mocha-phantomjs — pull request #91 by hokaccha (2013-08-20 08:41:15+00:00)
Title: Add window.mochaPhantomJS.env

I modified to pass environment variable to browser JS.

For instance:

```javascript
var version = window.mochaPhantomJS.env.JQUERY_VERSION;
var src = 'path/to/jquery-' + version '.js';
document.write('');

// run test ...
```

```
$ JQUERY_VERSION=1.9.1 mocha-phantomjs test/index.html
#=> run jquery 1.9.1

$ JQUERY_VERSION=2.0.2 mocha-phantomjs test/index.html
#=> run jquery 2.0.2
```

This will be useful in the Travis CI.

```yaml
language: node_js
- 0.8
env:
- JQUERY_VERSION=1.6.4
- JQUERY_VERSION=1.7.2
- JQUERY_VERSION=1.8.3
- JQUERY_VERSION=1.10.2
- JQUERY_VERSION=2.0.2
script: ./node_modules/.bin/mocha-phantomjs test/index.html
```