pocesar/grunt-mocha-istanbul

problems with space in project path path

Closed this issue · 2 comments

pouc commented

Hi,

my grunt task fails with the following error message : "ERROR: No coverage files found."

Istanbul works well from the command line.

The coverage.json file exists. I have a space in my project path.

The coverage path that is passed to istanbul is built using (index.js:53)

coverageFolder = path.join(process.cwd(), options.coverageFolder),

and thus contains the space

After a bit of reverse engineering I found the following. At the row lib/util/file-matcher.js:33 in instanbul the different paths passed to istanbul are joined using spaces. My coverage directory it thus viewed as 2 paths instead of one resulting in the error.

changing to a relative folder by changing the row to

coverageFolder =options.coverageFolder,

solves the issue. I guess this would introduce regressions as well...

I don't know if this is an instanbul issue or a grunt-mocha-istanbul issue.

Thanks

Regards,
pouc

hey @pouc, that's most likely a istanbul problem AFAIK. it should accept any type of path regardless if it has special characteres, spaces, unicode, etc. path.join is just to make sure that the path separator is used correctly, instead of forcing it to be / (in which Windows is \)

this should have been fixed in 5.0.0. coverageFolder and root can have spaces now