diff --git a/test/tap/bin-overwriting.js b/test/tap/bin-overwriting.js index 155d4abf52050..f5bbeca5748f4 100644 --- a/test/tap/bin-overwriting.js +++ b/test/tap/bin-overwriting.js @@ -8,10 +8,11 @@ const path = require('path') const readBinCb = process.platform === 'win32' ? readCmdShim : readlink const readBin = bin => new Promise((resolve, reject) => { readBinCb(bin, (er, target) => { - if (er) + if (er) { reject(er) - else + } else { resolve(path.resolve(pkg + '/global/bin', target)) + } }) })