From 840485f7ca723972d3c33166b625e665ea19aafe Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Fri, 3 May 2024 14:18:22 -0700 Subject: [PATCH] fix(linting): no-unused-vars --- lib/errors.js | 6 +++--- test/clone.js | 6 +++--- test/is-clean.js | 2 +- test/revs.js | 4 ++-- test/spawn.js | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/errors.js b/lib/errors.js index 7aeac47..3ceaa45 100644 --- a/lib/errors.js +++ b/lib/errors.js @@ -8,7 +8,7 @@ class GitError extends Error { } class GitConnectionError extends GitError { - constructor (message) { + constructor () { super('A git connection error occurred') } @@ -18,13 +18,13 @@ class GitConnectionError extends GitError { } class GitPathspecError extends GitError { - constructor (message) { + constructor () { super('The git reference could not be found') } } class GitUnknownError extends GitError { - constructor (message) { + constructor () { super('An unknown git error occurred') } } diff --git a/test/clone.js b/test/clone.js index 6d802a9..988e727 100644 --- a/test/clone.js +++ b/test/clone.js @@ -28,7 +28,7 @@ let repoSha = '' let submodsRepoSha = '' t.setTimeout(120000) -t.test('create repo', { bail: true }, t => { +t.test('create repo', { bail: true }, () => { const git = (...cmd) => spawnGit(cmd, { cwd: repo }) const write = (f, c) => fs.writeFileSync(`${repo}/${f}`, c) return git('init', '-b', 'main') @@ -100,7 +100,7 @@ t.test('spawn daemon', { bail: true }, t => { daemon.on('close', () => fs.rmSync(me, { recursive: true, force: true })) }) -t.test('create a repo with a submodule', { bail: true }, t => { +t.test('create a repo with a submodule', { bail: true }, () => { const submoduleRepo = resolve(me, 'submodule-repo') const git = (...cmd) => spawnGit(cmd, { cwd: submoduleRepo }) const write = (f, c) => fs.writeFileSync(`${submoduleRepo}/${f}`, c) @@ -226,7 +226,7 @@ const clonedRepo = join(me, clonedRepoDir) const clonedRepoSpaces = join(me, clonedSpacesRepoDir) const clonedRepoSpaces2 = join(me, clonedSpacesRepoDir2) -t.test('setup aditional tests', t => { +t.test('setup aditional tests', () => { const git = (...cmd) => spawnGit(cmd, { cwd: regularRepo }) const write = (f, c) => fs.writeFileSync(`${regularRepo}/${f}`, c) return git('init', '-b', 'main') diff --git a/test/is-clean.js b/test/is-clean.js index a7e875e..491487d 100644 --- a/test/is-clean.js +++ b/test/is-clean.js @@ -8,7 +8,7 @@ const { promisify } = require('util') const writeFile = promisify(require('fs').writeFile) const write = (file, data) => writeFile(resolve(repo, file), data) -t.test('create git repo', t => +t.test('create git repo', () => spawn(['init'], { cwd: repo }) .then(() => spawn(['config', 'user.name', 'pacotedev'], { cwd: repo })) .then(() => spawn(['config', 'user.email', 'i+pacotedev@izs.me'], { cwd: repo })) diff --git a/test/revs.js b/test/revs.js index 4e14e6e..ba6e5da 100644 --- a/test/revs.js +++ b/test/revs.js @@ -25,7 +25,7 @@ const fixMainBranch = (err) => { return git('init') } const write = (f, c) => fs.writeFileSync(`${repo}/${f}`, c) -t.test('setup', t => +t.test('setup', () => git('init', '-b', mainBranch).catch(fixMainBranch) .then(() => git('config', 'user.name', 'pacotedev')) .then(() => git('config', 'user.email', 'i+pacotedev@izs.me')) @@ -57,7 +57,7 @@ t.test('point latest at HEAD', t => latest: '69.42.0', }))) -t.test('add a latest branch, point to 1.2.3 version', t => +t.test('add a latest branch, point to 1.2.3 version', () => git('checkout', '-b', 'latest') .then(() => git('reset', '--hard', 'version-1.2.3')) .then(() => git('checkout', mainBranch)) diff --git a/test/spawn.js b/test/spawn.js index da09581..b68fbc6 100644 --- a/test/spawn.js +++ b/test/spawn.js @@ -27,7 +27,7 @@ t.test('argument test for allowReplace', async t => { // for our purposes. This just tests that the argument is added // by default. const mockedSpawn = t.mock('../lib/spawn.js', { - '@npmcli/promise-spawn': async (exe, args, opts) => args, + '@npmcli/promise-spawn': async (exe, args) => args, }) const [allow, deny, allowWithArg, denyWithArg] = await Promise.all([ mockedSpawn(['a', 'b', 'c'], { allowReplace: true }),