Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Coverage File Paths #382

Closed
mbielski opened this issue Mar 8, 2013 · 3 comments
Closed

Code Coverage File Paths #382

mbielski opened this issue Mar 8, 2013 · 3 comments

Comments

@mbielski
Copy link

mbielski commented Mar 8, 2013

In the documentation for Code Coverage (http://testacular.github.com/0.6.0/config/coverage.html) there is no specific direction about the file paths that the code coverage preprocessors use. The assumption could be that they use the basePath value, but after looking at the examples in Testacular and Istanbul it appears that the path for each file must be preceded by "**/".

Some clarity in the documentation would be helpful.

@vojtajina
Copy link
Contributor

We should be consistent:

  • all relative paths are resolved to basePath (which is resolved to path of the config file, if relative)
  • all patterns are matched using minimatch

@ghost ghost assigned vojtajina Mar 13, 2013
@ngiebel
Copy link

ngiebel commented Mar 28, 2013

The fix breaks minimatch functionality when negation is used in a pattern due to the fact that path.resolve returns the absolute path with the negation no longer at the beginning of the pattern.
A simple example is:
var path = require('path');
var mm = require('minimatch');
var pattern = '!*/.js';
var normalizedPattern = path.resolve(pattern);
var filePath = path.resolve('/some/path/to/file.coffee');
mm(filePath,pattern);
true
mm(filePath,normalizedPattern);
false

@vojtajina
Copy link
Contributor

Thanks @ngiebel that's a bug, I created an issue for it...

vojtajina added a commit that referenced this issue Mar 29, 2013
Merged from master to stable.

Closes #382

Conflicts:
	lib/config.js
	test/unit/config.spec.coffee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants