Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

coveralls github integration (with qunit, istanbul, grunt)

I'm having issues getting coveralls to work. I've created a simple project here.

It seems to be outputting the report correctly, but I'm definitely missing a step somewhere because coveralls doesn't see me as being set up. No branches show up, and it simply gives instructions on how to set it up. I've tried to copy what qunit is doing, because they obviously have it working.

Here is what I've done so far.

Created the project that uses node/grunt/qunit as well as the coveralls account and toggled on the project. I've then replaced the qunit reference in the devDependencies section in package.json with this.

"grunt-coveralls": "0.3.0",
"grunt-qunit-istanbul": "^0.4.0"

I've added this to my package.json.

"scripts": {
    "ci": "grunt && grunt coveralls"
}

I've added this config for qunit in my Gruntfile.js.

options: {
    timeout: 30000,
    "--web-security": "no",
    coverage: {
        src: [ "src/<%= pkg.name %>.js" ],
        instrumentedFiles: "temp/",
        coberturaReport: "report/",
        htmlReport: "build/report/coverage",
        lcovReport: "build/report/lcov",
        linesThresholdPct: 70
    }
},

I then added this to my .travis.yml.

language: node_js

node_js:
    - "0.10"
before_install: 
    npm install -g grunt-cli
install: 
    npm install
before_script: 
    grunt
after_script:
    npm run-script coveralls
like image 678
Todd Horst Avatar asked Mar 18 '14 20:03

Todd Horst


1 Answers

I got it working, check the repo for the example https://github.com/thorst/Code-Coverage-Qunit

While its not always possible, I found jasmine to be easier in multiple ways. I have a complete example here: https://github.com/thorst/Code-Coverage-Jasmine

I still haven't gotten mocha to work though. That (broken) repo is here: https://github.com/thorst/Code-Coverage-Mocha

like image 106
Todd Horst Avatar answered Sep 22 '22 18:09

Todd Horst