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

exports.process function works incorrectly if instrumentedSource contains "parent directory" pattern #39

Open
KozhinM opened this issue Feb 2, 2015 · 1 comment
Labels

Comments

@KozhinM
Copy link

KozhinM commented Feb 2, 2015

Hi,
We are using grunt-template-jasmine-istanbul in dash.js project and we recently faced the following issue:
In scr/main/js/template.js there is exports.process function. It has a check at line #193:

    if (!grunt.file.isMatch(files, instrumentedSource)) {
        return;
    }

Where var files = context.options.files || '**/*';
 
If files = '**/*' and instrumentedSource contains a "parent directory" pattern, e.g. '../someFile.js' the result of the grunt.file.isMatch function is always false. Thus, the function always returns right after the check and never goes farther.
 
We were able to fix it locally this way:
• Replace the pattern with '*.*'
• Add {matchBase: true} option as a first parameter of isMatch function

We found out that the issue was introduced by this commit:
d2212fb

@maenu
Copy link
Owner

maenu commented Feb 3, 2015

The intention of '**/*' was that it matches any path, so this is definitely a bug. I am a bit surprised that this doesn't work with parent directories. We need to find out which pattern needs to be used and some tests.

@gyandeeps gyandeeps added the bug label May 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants