coffee-coverage
Advanced tools
Comparing version 0.7.0 to 1.0.0
# coffee-coverage Changelog | ||
### v1.0.0 | ||
- [#71: Accept globs as excludes](https://github.com/benbria/coffee-coverage/pull/71) Many thanks to | ||
[dbartholomae](https://github.com/dbartholomae) for this much requested feature. Note that excludes will still | ||
match if they are prefixes (so you can still use /node_modules to eliminate everything in the /node_modules | ||
folder), but you can also use globs here. | ||
### v0.7.0 | ||
@@ -110,4 +116,1 @@ - [#64: Add `postProcessors` option to `register()`](https://github.com/benbria/coffee-coverage/pull/64) and deprecate `streamlinejs` option. | ||
"init" and a "js" which must be concatenated to get fully instrumented source. | ||
@@ -65,2 +65,6 @@ Instrumenting Files at Compile Time | ||
You can also use globs. If you have your specs next to your code you might e.g. use: | ||
coffeeCoverage --exclude 'node_modules,.git,**/*.spec.coffee' | ||
#### --path | ||
@@ -67,0 +71,0 @@ |
// Generated by CoffeeScript 1.9.2 | ||
(function() { | ||
var EXTENSIONS, _, assert, fs, path, statFile, | ||
var EXTENSIONS, _, assert, fs, glob, path, statFile, | ||
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; | ||
@@ -16,2 +16,4 @@ | ||
glob = require('glob'); | ||
exports.stripLeadingDotOrSlash = function(pathName) { | ||
@@ -74,2 +76,13 @@ return pathName.replace(/^\//, "").replace(/^\.\//, ""); | ||
} | ||
exclude.map(function(pattern) { | ||
return glob.sync(pattern, { | ||
dot: true, | ||
cwd: basePath, | ||
root: basePath | ||
}).forEach(function(file) { | ||
if (relativeFilename === path.normalize(file)) { | ||
return excluded = true; | ||
} | ||
}); | ||
}); | ||
components = relativeFilename.split(path.sep); | ||
@@ -76,0 +89,0 @@ for (i = 0, len = components.length; i < len; i++) { |
@@ -15,3 +15,3 @@ { | ||
], | ||
"version": "0.7.0", | ||
"version": "1.0.0", | ||
"author": "Benbria (http://www.benbria.com/)", | ||
@@ -49,2 +49,3 @@ "contributors": [ | ||
"lodash": "^3.7.0", | ||
"glob": "^6.0.4", | ||
"pkginfo": ">=0.2.3" | ||
@@ -51,0 +52,0 @@ }, |
@@ -32,10 +32,11 @@ Istanbul and JSCoverage-style instrumentation for CoffeeScript files. | ||
npm install --save-dev coffee-coverage | ||
npm install --save-dev istanbul | ||
mocha --recursive \ | ||
--compilers coffee:coffee-script/register \ | ||
--require coffee-coverage/register-istanbul \ | ||
test | ||
./node_modules/.bin/istanbul report | ||
```bash | ||
$ npm install --save-dev coffee-coverage | ||
$ npm install --save-dev istanbul | ||
$ mocha --recursive --compilers coffee:coffee-script/register --require coffee-coverage/register-istanbul test | ||
$ ./node_modules/.bin/istanbul report | ||
``` | ||
You should now have an Istanbul coverage report in ./coverage/lcov-report/index.html. | ||
@@ -42,0 +43,0 @@ |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
110315
1732
1880
0
66
5
+ Addedglob@^6.0.4
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedglob@6.0.4(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedwrappy@1.0.2(transitive)