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

Commit

Permalink
Measure coverage for all js tests
Browse files Browse the repository at this point in the history
Instrument spec.js for test coverage
measurement.

Instrument all .js files in the test
directory.
  • Loading branch information
saper committed Aug 8, 2015
1 parent 1263983 commit 433cde6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/**
test/coverage/html
2 changes: 1 addition & 1 deletion scripts/coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function coverage() {
instrumentedfiles.push(source);
if (instrumentedfiles.length === sourcefiles.length) {
fs.readdirSync('test').filter(function(file){
return file.substr(-6) === 'api.js';
return file.substr(-3) === '.js';
}).forEach(function(file){
mocha.addFile(
path.join('test', file)
Expand Down
4 changes: 3 additions & 1 deletion test/spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ var assert = require('assert'),
exists = fs.existsSync,
path = require('path'),
read = fs.readFileSync,
sass = require('../lib'),
sass = process.env.NODESASS_COV
? require('../lib-cov')
: require('../lib'),
util = require('./util');

describe('spec', function() {
Expand Down

0 comments on commit 433cde6

Please # to comment.