Skip to content

Commit

Permalink
style: prettier formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdlg committed Nov 21, 2019
1 parent 742b521 commit 5ffcf51
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
5 changes: 4 additions & 1 deletion lib/success.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ module.exports = async (pluginConfig, context) => {
) || shas.includes((await github.pullRequests.get({owner, repo, pull_number: number})).data.merge_commit_sha)
);

debug('found pull requests: %O', prs.map(pr => pr.number));
debug(
'found pull requests: %O',
prs.map(pr => pr.number)
);

// Parse the release commits message and PRs body to find resolved issues/PRs via comment keyworkds
const issues = [...prs.map(pr => pr.body), ...commits.map(commit => commit.message)].reduce((issues, message) => {
Expand Down
5 changes: 4 additions & 1 deletion test/find-sr-issue.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ test.serial('Return empty array if not issues has matching ID', async t => {
const repo = 'test_repo';
const githubToken = 'github_token';
const title = 'The automated release is failing 🚨';
const issues = [{number: 1, body: 'Issue 1 body', title}, {number: 2, body: 'Issue 2 body', title}];
const issues = [
{number: 1, body: 'Issue 1 body', title},
{number: 2, body: 'Issue 2 body', title},
];
const github = authenticate({}, {githubToken})
.get(
`/search/issues?q=${escape('in:title')}+${escape(`repo:${owner}/${repo}`)}+${escape('type:issue')}+${escape(
Expand Down
5 changes: 4 additions & 1 deletion test/glob-assets.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ test('Favor Object over String values when removing duplicates', async t => {

t.deepEqual(
sortAssets(globbedAssets),
sortAssets([{path: 'upload.txt', name: 'upload_name'}, {path: 'upload_other.txt', name: 'upload_other_name'}])
sortAssets([
{path: 'upload.txt', name: 'upload_name'},
{path: 'upload_other.txt', name: 'upload_other_name'},
])
);
});

Expand Down
20 changes: 16 additions & 4 deletions test/success.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,15 @@ test.serial(
const env = {GITHUB_TOKEN: 'github_token'};
const failTitle = 'The automated release is failing 🚨';
const pluginConfig = {failTitle};
const prs = [{number: 1, pull_request: {}, state: 'closed'}, {number: 2, pull_request: {}, state: 'closed'}];
const prs = [
{number: 1, pull_request: {}, state: 'closed'},
{number: 2, pull_request: {}, state: 'closed'},
];
const options = {branch: 'master', repositoryUrl: `https://github.com/${owner}/${repo}.git`};
const commits = [{hash: '123', message: 'Commit 1 message'}, {hash: '456', message: 'Commit 2 message'}];
const commits = [
{hash: '123', message: 'Commit 1 message'},
{hash: '456', message: 'Commit 2 message'},
];
const nextRelease = {version: '1.0.0'};
const releases = [{name: 'GitHub release', url: 'https://github.com/release'}];
const github = authenticate(env)
Expand Down Expand Up @@ -629,9 +635,15 @@ test.serial('Ignore errors when adding comments and closing issues', async t =>
{number: 2, body: `Issue 2 body\n\n${ISSUE_ID}`, title: failTitle},
{number: 3, body: `Issue 3 body\n\n${ISSUE_ID}`, title: failTitle},
];
const prs = [{number: 1, pull_request: {}, state: 'closed'}, {number: 2, pull_request: {}, state: 'closed'}];
const prs = [
{number: 1, pull_request: {}, state: 'closed'},
{number: 2, pull_request: {}, state: 'closed'},
];
const options = {repositoryUrl: `https://github.com/${owner}/${repo}.git`};
const commits = [{hash: '123', message: 'Commit 1 message'}, {hash: '456', message: 'Commit 2 message'}];
const commits = [
{hash: '123', message: 'Commit 1 message'},
{hash: '456', message: 'Commit 2 message'},
];
const nextRelease = {version: '1.0.0'};
const releases = [{name: 'GitHub release', url: 'https://github.com/release'}];
const github = authenticate(env)
Expand Down

0 comments on commit 5ffcf51

Please sign in to comment.