From 100a4b73111065aebc5284f5f7060c9665c4279a Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Fri, 3 May 2024 14:07:17 -0700 Subject: [PATCH] fix(linting): no-unused-vars --- lib/shim-bin.js | 2 +- test/check-bins.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) 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 })))