From e143667157e4e42b9e59a44ea61cea2d886d014e Mon Sep 17 00:00:00 2001 From: Glenn Hinks Date: Sun, 18 Apr 2021 16:58:27 -0400 Subject: [PATCH] feat: clean PR lint fixes --- lib/closePR.js | 6 +++--- test/cli/closePR.js | 1 - test/closePR.js | 12 ++++++------ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/closePR.js b/lib/closePR.js index d117df1..9794c7c 100644 --- a/lib/closePR.js +++ b/lib/closePR.js @@ -8,7 +8,7 @@ const gitURLParse = require('git-url-parse') const debug = logger('wiby:closepr') module.exports = async ({ dependents }) => { - const closedPrs = []; + const closedPrs = [] for (const { repository: url, pullRequest } of dependents) { if (pullRequest) { const dependentPkgInfo = gitURLParse(url) @@ -16,12 +16,12 @@ module.exports = async ({ dependents }) => { const branch = await context.getTestingBranchName(parentBranchName) const resp = await github.getChecks(dependentPkgInfo.owner, dependentPkgInfo.name, branch) const closedPR = await closeDependencyPR(dependentPkgInfo.owner, dependentPkgInfo.name, branch, resp.data.check_runs) - if (!!closedPR) { + if (closedPR) { closedPrs.push(closedPR) } } } - return closedPrs; + return closedPrs } const closeDependencyPR = module.exports.closeDependencyPR = async function closeDependencyPR (owner, repo, branch, checkRuns) { diff --git a/test/cli/closePR.js b/test/cli/closePR.js index d725a3a..3c9c989 100644 --- a/test/cli/closePR.js +++ b/test/cli/closePR.js @@ -4,7 +4,6 @@ const gitFixture = require('../fixtures/git') const childProcess = require('child_process') const nock = require('nock') const path = require('path') -const fs = require('fs') const wibyCommand = path.join(__dirname, '..', '..', 'bin', 'wiby') const fixturesPath = path.resolve(path.join(__dirname, '..', 'fixtures')) diff --git a/test/closePR.js b/test/closePR.js index bde2d69..60ce13b 100644 --- a/test/closePR.js +++ b/test/closePR.js @@ -64,10 +64,10 @@ tap.test('close PR', (t) => { }) t.test('closePR Cli function tests', (t) => { t.plan(2) - t.test('closePR should not close PRs', async(t) => { - //nock setup + t.test('closePR should not close PRs', async (t) => { + // nock setup nock('https://api.github.com') - .get(/repos.*check\-runs/) + .get(/repos.*check-runs/) .reply(200, { data: {} }) @@ -82,12 +82,12 @@ tap.test('close PR', (t) => { t.equal(result.length, 0) }) - t.test('closePR should close a single PR', async(t) => { + t.test('closePR should close a single PR', async (t) => { gitFixture.init() const branch = context.getTestingBranchName(await context.getParentBranchName()) - //nock setup + // nock setup nock('https://api.github.com') - .get(/repos.*check\-runs/) + .get(/repos.*check-runs/) .reply(200, { check_runs: [ {