Skip to content

Commit

Permalink
Paths in windows use backslash (fixes #178)
Browse files Browse the repository at this point in the history
  • Loading branch information
tswaters committed Aug 23, 2015
1 parent c65074b commit f99a826
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/preprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function createCoveragePreprocessor (logger, helper, basePath, reporters, covera
return function (content, file, done) {
log.debug('Processing "%s".', file.originalPath)

var jsPath = require.resolve(file.originalPath)
// default instrumenters
var instrumenterLiteral = 'istanbul'

Expand Down Expand Up @@ -105,7 +106,7 @@ function createCoveragePreprocessor (logger, helper, basePath, reporters, covera
options = extend(options, {codeGenerationOptions: codeGenerationOptions})

var instrumenter = new InstrumenterConstructor(options)
instrumenter.instrument(content, file.originalPath, function (err, instrumentedCode) {
instrumenter.instrument(content, jsPath, function (err, instrumentedCode) {
if (err) {
log.error('%s\n at %s', err.message, file.originalPath)
}
Expand All @@ -120,7 +121,7 @@ function createCoveragePreprocessor (logger, helper, basePath, reporters, covera
}

// remember the actual immediate instrumented JS for given original path
sourceCache[file.originalPath] = content
sourceCache[jsPath] = content

if (includeAllSources) {
var coverageObjMatch = coverageObjRegex.exec(instrumentedCode)
Expand Down

0 comments on commit f99a826

Please sign in to comment.