grunt-qunit-istanbul icon indicating copy to clipboard operation
grunt-qunit-istanbul copied to clipboard

[regression] instrumentedFiles -> temp folder not created properly resulting in error every other run

Open tyge68 opened this issue 8 years ago • 2 comments

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.

tyge68 avatar Jan 03 '17 10:01 tyge68

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 avatar Jan 16 '17 10:01 agistrilink

@agistrilink I link the workaround here.

fabschen avatar Jan 19 '17 10:01 fabschen