Skip to content
This repository has been archived by the owner on Jul 26, 2018. It is now read-only.

Commit

Permalink
Merge pull request #154 from avernois/mocha_on_travis
Browse files Browse the repository at this point in the history
allow to run javascript test from console line with mocha-phantomjs
  • Loading branch information
avernois committed Sep 23, 2015
2 parents 3a8c402 + 37185d3 commit 51d4777
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
before_script:
- wget http://stedolan.github.io/jq/download/linux64/jq && chmod u+x jq
- npm install -g mocha
- npm install mocha-phantomjs

script:
- ./jq '.' locations/*.json
- ./node_modules/mocha-phantomjs/bin/mocha-phantomjs ./test/index.html
8 changes: 8 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ Open issue, fork, commit and pull request. But you already know that :)

Please, don't improve code/add new feature and add new places/locations in the same pull request.

### Unit testing
We now can run unit tests against devfriendlyplaces code. You can start them by two ways:
* from your favorite browser, open the file test/index.html
* from the console
* you first need to have a valid npm installation. Then
* `npm install -g mocha`
* `npm install mocha-phantomjs chai`
* then `./node_modules/mocha-phantomjs/bin/mocha-phantomjs ./test/index.html`

[albi]: http://albi.devfriendlyplaces.net
[angers]: http://angers.devfriendlyplaces.net
Expand Down
2 changes: 1 addition & 1 deletion test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<script src="../js/map.js"></script>
<script src="../js/locations.js"></script>
<script src="./test.js"></script>
<script>mocha.run();</script>
<script>(window.mochaPhantomJS || window.mocha).run();</script>
</body>
</html>

0 comments on commit 51d4777

Please sign in to comment.