diff --git a/lib/shim-bin.js b/lib/shim-bin.js index d5e19c0..67e2702 100644 --- a/lib/shim-bin.js +++ b/lib/shim-bin.js @@ -17,7 +17,7 @@ const fixBin = require('./fix-bin.js') // nondeterminism. const seen = new Set() -const failEEXIST = ({ path, to, from }) => +const failEEXIST = ({ to, from }) => Promise.reject(Object.assign(new Error('EEXIST: file already exists'), { path: to, dest: from, diff --git a/test/check-bins.js b/test/check-bins.js index e4bbadd..68bdec6 100644 --- a/test/check-bins.js +++ b/test/check-bins.js @@ -12,22 +12,24 @@ const checkBins = requireInject('../lib/check-bins.js', { const o = { global: true, force: false, top: true } t.test('gets normalized', t => - checkBins({ pkg: { bin: 'lib/foo.js', name: 'foo' }, ...o })) + t.resolves(checkBins({ pkg: { bin: 'lib/foo.js', name: 'foo' }, ...o }))) t.test('ok if all ok', t => - checkBins({ pkg: { bin: { foo: 'lib/foo.js' } }, ...o })) + t.resolves(checkBins({ pkg: { bin: { foo: 'lib/foo.js' } }, ...o }))) t.test('no bin is fine', t => - checkBins({ pkg: {}, ...o })) + t.resolves(checkBins({ pkg: {}, ...o }))) t.test('always ok if forced', t => - checkBins({ pkg: { bin: { foo: 'lib/foo.js', fail: 'fail.js' } }, ...o, force: true })) + // eslint-disable-next-line max-len + t.resolves(checkBins({ pkg: { bin: { foo: 'lib/foo.js', fail: 'fail.js' } }, ...o, force: true }))) t.test('always ok if not global', t => - checkBins({ pkg: { bin: { foo: 'lib/foo.js', fail: 'fail.js' } }, ...o, global: false })) + // eslint-disable-next-line max-len + t.resolves(checkBins({ pkg: { bin: { foo: 'lib/foo.js', fail: 'fail.js' } }, ...o, global: false }))) t.test('always ok if not top', t => - checkBins({ pkg: { bin: { foo: 'lib/foo.js', fail: 'fail.js' } }, ...o, top: false })) + t.resolves(checkBins({ pkg: { bin: { foo: 'lib/foo.js', fail: 'fail.js' } }, ...o, top: false }))) t.test('fail if any fail', t => t.rejects(checkBins({ pkg: { bin: { foo: 'lib/foo.js', fail: 'fail.js' } }, ...o })))