grunt-qunit-istanbul
grunt-qunit-istanbul copied to clipboard
[regression] instrumentedFiles -> temp folder not created properly resulting in error every other run
I have a odd issue since using version 1.0.0 of this plugin.
Now each time I execute the qunit task configured as follow:
qunit: {
options: {
'--web-security': 'no',
coverage: {
disposeCollector: true,
src: ['src/**/*.js'],
instrumentedFiles: 'temp/',
jsonSummaryReport: 'report/json',
htmlReport: 'report/coverage',
lcovReport: 'report/',
excludes: ['libs/*'],
linesThresholdPct: 80
}
},
all: ['testing/index.html']
}
It fails every other run, from the investigation , it never fail if I make sure that the instrumentedFiles ("temp/") folder is created before executing. Which explain why it fails every other run then, as when it fails, the "temp/" folder is not removed, so the next run passes.
A workaround can be to alter the code in the tasks/qunit.js:241 by wrapping the options.coverage.instrumentedFiles to fs.realpathSync(options.coverage.instrumentedFiles).
The other, preferable workaround (no code change!) is to specify an absolute and portable path, e.g. /tmp.
@agistrilink I link the workaround here.