Skip to content

Commit

Permalink
Set up Coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasbynens committed May 25, 2014
1 parent cd4698c commit a4368cc
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .gitignore
@@ -1,5 +1,5 @@
# JSON version of coverage report
coverage/coverage.json
# Coverage report
coverage

# Installed npm modules
node_modules
Expand Down
4 changes: 3 additions & 1 deletion .travis.yml
Expand Up @@ -15,4 +15,6 @@ before_script:
# If the enviroment stores rt.jar in a different directory, find it and symlink the directory
- "PREFIX=/usr/lib/jvm; if [ ! -d $PREFIX/java-6-openjdk ]; then for d in $PREFIX/java-6-openjdk-*; do if [ -e $d/jre/lib/rt.jar ]; then sudo ln -s $d $PREFIX/java-6-openjdk; break; fi; done; fi"
script:
"grunt travis"
- "grunt ci"
after_script:
- "grunt shell:cover-coveralls"
13 changes: 8 additions & 5 deletions Gruntfile.js
Expand Up @@ -7,9 +7,12 @@ module.exports = function(grunt) {
'stderr': true,
'failOnError': true
},
'cover': {
'cover-html': {
'command': 'istanbul cover --report "html" --verbose --dir "coverage" "tests/tests.js"'
},
'cover-coveralls': {
'command': 'istanbul cover --verbose --dir "coverage" "tests/tests.js" && cat coverage/lcov.info | coveralls; rm -rf coverage/lcov*'
},
'test-narwhal': {
'command': 'echo "Testing in Narwhal..."; export NARWHAL_OPTIMIZATION=-1; narwhal "tests/tests.js"'
},
Expand Down Expand Up @@ -53,16 +56,16 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-template');

grunt.registerTask('cover', 'shell:cover');
grunt.registerTask('travis', [
grunt.registerTask('cover', 'shell:cover-html');
grunt.registerTask('ci', [
'shell:test-narwhal',
'shell:test-phantomjs',
'shell:test-rhino',
'shell:test-ringo',
'shell:test-node',
'shell:test-node'
]);
grunt.registerTask('test', [
'travis',
'ci',
'shell:test-browser'
]);

Expand Down
4 changes: 2 additions & 2 deletions README.md
@@ -1,4 +1,4 @@
# jsesc [![Build status](https://travis-ci.org/mathiasbynens/jsesc.svg?branch=master)](https://travis-ci.org/mathiasbynens/jsesc) [![Dependency status](https://gemnasium.com/mathiasbynens/jsesc.svg)](https://gemnasium.com/mathiasbynens/jsesc)
# jsesc [![Build status](https://travis-ci.org/mathiasbynens/jsesc.svg?branch=master)](https://travis-ci.org/mathiasbynens/jsesc) [![Code coverage status](http://img.shields.io/coveralls/mathiasbynens/jsesc/master.svg)](https://coveralls.io/r/mathiasbynens/jsesc) [![Dependency status](https://gemnasium.com/mathiasbynens/jsesc.svg)](https://gemnasium.com/mathiasbynens/jsesc)

This is a JavaScript library for [escaping JavaScript strings](http://mathiasbynens.be/notes/javascript-escapes) while generating the shortest possible valid ASCII-only output. [Here’s an online demo.](http://mothereff.in/js-escapes)

Expand Down Expand Up @@ -362,7 +362,7 @@ After cloning this repository, run `npm install` to install the dependencies nee

Once that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, and web browsers as well, use `grunt test`.

To generate [the code coverage report](http://rawgithub.com/mathiasbynens/jsesc/master/coverage/jsesc/jsesc.js.html), use `grunt cover`.
To generate the code coverage report, use `grunt cover`.

## Author

Expand Down
1 change: 1 addition & 0 deletions component.json
Expand Up @@ -11,6 +11,7 @@
"keywords": [
"string",
"escape",
"javascript",
"tool"
]
}
16 changes: 9 additions & 7 deletions package.json
Expand Up @@ -9,6 +9,7 @@
"keywords": [
"string",
"escape",
"javascript",
"tool"
],
"licenses": [
Expand Down Expand Up @@ -41,13 +42,14 @@
"test": "node tests/tests.js"
},
"devDependencies": {
"grunt": "~0.4.4",
"grunt-shell": "~0.6.4",
"grunt-template": "~0.2.3",
"istanbul": "~0.2.7",
"qunit-extras": "~1.0.0",
"coveralls": "^2.10.0",
"grunt": "^0.4.4",
"grunt-shell": "^0.6.4",
"grunt-template": "^0.2.3",
"istanbul": "^0.2.7",
"qunit-extras": "^1.0.0",
"qunitjs": "~1.11.0",
"regenerate": "~0.6.0",
"requirejs": "~2.1.11"
"regenerate": "^0.6.0",
"requirejs": "^2.1.11"
}
}

0 comments on commit a4368cc

Please sign in to comment.