From a4368cc02063500fedd3fbae99c8042a086a4e8b Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Sun, 25 May 2014 11:20:01 +0200 Subject: [PATCH] Set up Coveralls --- .gitignore | 4 ++-- .travis.yml | 4 +++- Gruntfile.js | 13 ++++++++----- README.md | 4 ++-- component.json | 1 + package.json | 16 +++++++++------- 6 files changed, 25 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 9368adf..444ec4d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -# JSON version of coverage report -coverage/coverage.json +# Coverage report +coverage # Installed npm modules node_modules diff --git a/.travis.yml b/.travis.yml index b8837cb..37eb3b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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" diff --git a/Gruntfile.js b/Gruntfile.js index 2c42f72..d3c8079 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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"' }, @@ -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' ]); diff --git a/README.md b/README.md index a44fc81..7a083c7 100644 --- a/README.md +++ b/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) @@ -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 diff --git a/component.json b/component.json index 4b1e6e6..a9b66af 100644 --- a/component.json +++ b/component.json @@ -11,6 +11,7 @@ "keywords": [ "string", "escape", + "javascript", "tool" ] } diff --git a/package.json b/package.json index 856f239..8765798 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "keywords": [ "string", "escape", + "javascript", "tool" ], "licenses": [ @@ -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" } }