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

Commit

Permalink
Add Coverall.io CI coverage
Browse files Browse the repository at this point in the history
Adds JSCoverage instrumentation for coveralls.io on Travis
  • Loading branch information
nschonni committed Jan 13, 2014
1 parent ea60797 commit f9538c8
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ vagrant
.DS_Store
.sass-cache

bin/*-v8-*
bin/*-v8-*

lib-coverage/
sass-coverage.js
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
language: node_js
node_js:
- 0.10
- "0.10"
after_success:
- npm run-script coverage
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![NPM version](https://badge.fury.io/js/node-sass.png)](http://badge.fury.io/js/node-sass)
[![Dependency Status](https://david-dm.org/andrew/node-sass.png?theme=shields.io)](https://david-dm.org/andrew/node-sass)
[![devDependency Status](https://david-dm.org/andrew/node-sass/dev-status.png?theme=shields.io)](https://david-dm.org/andrew/node-sass#info=devDependencies)
[![Coverage Status](https://coveralls.io/repos/andrew/node-sass/badge.png)](https://coveralls.io/r/andrew/node-sass)

Node-sass is a library that provides binding for Node.js to [libsass](https://github.com/hcatlin/libsass), the C version of the popular stylesheet preprocessor, Sass.

Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"scripts": {
"install": "node build.js",
"test": "mocha test",
"coverage": "bash scripts/coverage.sh",
"pretest": "jshint .",
"prepublish": "bash scripts/prepublish.sh"
},
Expand All @@ -45,6 +46,9 @@
"nan": "~0.6.0"
},
"devDependencies": {
"jshint": "~2.4.0"
"jshint": "~2.4.0",
"coveralls": "~2.6.1",
"mocha-lcov-reporter": "0.0.1",
"jscoverage": "~0.3.8"
}
}
6 changes: 6 additions & 0 deletions scripts/coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

./node_modules/.bin/jscoverage sass.js sass-coverage.js
./node_modules/.bin/jscoverage lib lib-coverage

NODESASS_COVERAGE=1 ./node_modules/.bin/mocha test -R mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js
2 changes: 1 addition & 1 deletion test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var path = require('path'),
assert = require('assert'),
fs = require('fs'),
exec = require('child_process').exec,
cli = require('../lib/cli'),
cli = process.env.NODESASS_COVERAGE ? require('../lib-coverage/cli') : require('../lib/cli'),

cliPath = path.resolve(__dirname, '../bin/node-sass'),
sampleFilename = path.resolve(__dirname, 'sample.scss');
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*jshint multistr:true */
var sass = require('../sass');
var sass = process.env.NODESASS_COVERAGE ? require('../sass-coverage') : require('../sass');
var assert = require('assert');
var path = require('path');
var badSampleFilename = 'sample.scss';
Expand Down

0 comments on commit f9538c8

Please sign in to comment.