Skip to content

Commit

Permalink
fix(linting): no-unused-vars
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed May 4, 2024
1 parent b602aca commit 100a4b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/shim-bin.js
Expand Up @@ -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,
Expand Down
14 changes: 8 additions & 6 deletions test/check-bins.js
Expand Up @@ -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 })))

0 comments on commit 100a4b7

Please sign in to comment.