Skip to content

Commit

Permalink
WIP - debug coveralls not running fallback tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime Bargiel committed Sep 10, 2019
1 parent 7d8248c commit d288d84
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/copy-sync/copy-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ function mayCopyFile (srcStat, src, dest, opts) {
}
}

let copyFileUsed = false
let copyFileFallbackUsed = false

function copyFile (srcStat, src, dest, opts) {
if (typeof fs.copyFileSync === 'function') {
fs.copyFileSync(src, dest)
Expand All @@ -74,8 +77,10 @@ function copyFile (srcStat, src, dest, opts) {
// (through utimes call)
fs.chmodSync(dest, srcStat.mode | 0o200)
}
if (!copyFileUsed) { copyFileUsed = true; console.log('copyFile used (sync)') }
return setDestTimestampsAndMode(srcStat, src, dest, opts)
}
if (!copyFileFallbackUsed) { copyFileFallbackUsed = true; console.log('copyFileFallback used (sync)') }
return copyFileFallback(srcStat, src, dest, opts)
}

Expand Down
5 changes: 5 additions & 0 deletions lib/copy/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ function mayCopyFile (srcStat, src, dest, opts, cb) {
} else return cb()
}

let copyFileUsed = false
let copyFileFallbackUsed = false

function copyFile (srcStat, src, dest, opts, cb) {
if (typeof fs.copyFile === 'function') {
return fs.copyFile(src, dest, err => {
Expand All @@ -106,9 +109,11 @@ function copyFile (srcStat, src, dest, opts, cb) {
return setDestTimestampsAndMode(srcStat, src, dest, opts, cb)
})
}
if (!copyFileUsed) { copyFileUsed = true; console.log('copyFile used') }
return setDestTimestampsAndMode(srcStat, src, dest, opts, cb)
})
}
if (!copyFileFallbackUsed) { copyFileFallbackUsed = true; console.log('copyFileFallback used') }
return copyFileFallback(srcStat, src, dest, opts, cb)
}

Expand Down

0 comments on commit d288d84

Please sign in to comment.