Skip to content

Commit 7927594

Browse files
authored
Update dependencies (#112)
* Update dependencies * Fix linting errors after Prettier upgrade
1 parent b35f006 commit 7927594

File tree

4 files changed

+2381
-1723
lines changed

4 files changed

+2381
-1723
lines changed

create-or-update-files.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module.exports = function (octokit, opts) {
4343
if (!baseTree || forkFromBaseBranch) {
4444
if (!createBranch && !baseTree) {
4545
return reject(
46-
`The branch '${branchName}' doesn't exist and createBranch is 'false'`
46+
`The branch '${branchName}' doesn't exist and createBranch is 'false'`,
4747
);
4848
}
4949

@@ -86,7 +86,7 @@ module.exports = function (octokit, opts) {
8686

8787
if (!hasFiles && !hasFilesToDelete) {
8888
return reject(
89-
`either changes[].files or changes[].filesToDelete are required`
89+
`either changes[].files or changes[].filesToDelete are required`,
9090
);
9191
}
9292

@@ -101,14 +101,14 @@ module.exports = function (octokit, opts) {
101101
owner,
102102
repo,
103103
fileName,
104-
baseTree
104+
baseTree,
105105
);
106106

107107
// If it doesn't exist, and we're not ignoring missing files
108108
// reject the promise
109109
if (!exists && !change.ignoreDeletionFailures) {
110110
return reject(
111-
`The file ${fileName} could not be found in the repo`
111+
`The file ${fileName} could not be found in the repo`,
112112
);
113113
}
114114

@@ -121,7 +121,7 @@ module.exports = function (octokit, opts) {
121121
type: "commit",
122122
});
123123
}
124-
})
124+
}),
125125
);
126126
}
127127
}
@@ -144,7 +144,7 @@ module.exports = function (octokit, opts) {
144144
owner,
145145
repo,
146146
contents,
147-
type
147+
type,
148148
);
149149

150150
treeItems.push({
@@ -153,7 +153,7 @@ module.exports = function (octokit, opts) {
153153
mode: mode,
154154
type: type,
155155
});
156-
})
156+
}),
157157
);
158158
}
159159

@@ -168,7 +168,7 @@ module.exports = function (octokit, opts) {
168168
owner,
169169
repo,
170170
treeItems,
171-
baseTree
171+
baseTree,
172172
);
173173

174174
// Create a commit that points to that tree
@@ -180,7 +180,7 @@ module.exports = function (octokit, opts) {
180180
author,
181181
message,
182182
tree,
183-
baseTree
183+
baseTree,
184184
);
185185

186186
// Update the base tree if we have another commit to make
@@ -238,7 +238,7 @@ async function createCommit(
238238
author,
239239
message,
240240
tree,
241-
baseTree
241+
baseTree,
242242
) {
243243
return (
244244
await octokit.rest.git.createCommit({

create-or-update-files.test.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ test(`branch does not exist, createBranch false`, async () => {
7171
const body = { ...validRequest, createBranch: false };
7272

7373
await expect(run(body)).rejects.toEqual(
74-
`The branch 'new-branch-name' doesn't exist and createBranch is 'false'`
74+
`The branch 'new-branch-name' doesn't exist and createBranch is 'false'`,
7575
);
7676
});
7777

@@ -81,7 +81,7 @@ test(`branch does not exist, provided base does not exist`, async () => {
8181
const body = { ...validRequest };
8282

8383
await expect(run(body)).rejects.toEqual(
84-
`The branch 'base-branch-name' doesn't exist`
84+
`The branch 'base-branch-name' doesn't exist`,
8585
);
8686
});
8787

@@ -102,7 +102,7 @@ test(`no commit message`, async () => {
102102
],
103103
};
104104
await expect(run(body)).rejects.toEqual(
105-
`changes[].message is a required parameter`
105+
`changes[].message is a required parameter`,
106106
);
107107
});
108108

@@ -117,7 +117,7 @@ test(`no files provided (empty object)`, async () => {
117117
changes: [{ message: "Test Commit", files: {} }],
118118
};
119119
await expect(run(body)).rejects.toEqual(
120-
`either changes[].files or changes[].filesToDelete are required`
120+
`either changes[].files or changes[].filesToDelete are required`,
121121
);
122122
});
123123

@@ -129,7 +129,7 @@ test(`no files provided (missing object)`, async () => {
129129

130130
const body = { ...validRequest, changes: [{ message: "Test Commit" }] };
131131
await expect(run(body)).rejects.toEqual(
132-
`either changes[].files or changes[].filesToDelete are required`
132+
`either changes[].files or changes[].filesToDelete are required`,
133133
);
134134
});
135135

@@ -151,7 +151,7 @@ test(`no file contents provided`, async () => {
151151
],
152152
};
153153
await expect(run(body)).rejects.toEqual(
154-
`No file contents provided for test.md`
154+
`No file contents provided for test.md`,
155155
);
156156
});
157157

@@ -441,7 +441,7 @@ test("failure (fileToDelete is missing)", async () => {
441441
};
442442

443443
await expect(run(body)).rejects.toEqual(
444-
"The file wow-this-file-disappeared could not be found in the repo"
444+
"The file wow-this-file-disappeared could not be found in the repo",
445445
);
446446
});
447447

@@ -459,7 +459,7 @@ test("Does not overwrite other methods", () => {
459459

460460
function mockGetRef(branch, sha, success) {
461461
const m = nock("https://api.github.com").get(
462-
`/repos/${owner}/${repo}/git/ref/heads%2F${branch}`
462+
`/repos/${owner}/${repo}/git/ref/heads%2F${branch}`,
463463
);
464464

465465
const body = {
@@ -479,7 +479,7 @@ function mockCreateBlob(content, sha) {
479479
const expectedBody = { content: content, encoding: "base64" };
480480
const m = nock("https://api.github.com").post(
481481
`/repos/${owner}/${repo}/git/blobs`,
482-
expectedBody
482+
expectedBody,
483483
);
484484

485485
const body = {
@@ -493,21 +493,21 @@ function mockCreateBlob(content, sha) {
493493
function mockCreateBlobFileOne() {
494494
return mockCreateBlob(
495495
"IyBUaGlzIGlzIGEgdGVzdAoKSSBob3BlIGl0IHdvcmtz",
496-
"afb296bb7f3e327767bdda481c4877ba4a09e02e"
496+
"afb296bb7f3e327767bdda481c4877ba4a09e02e",
497497
);
498498
}
499499

500500
function mockCreateBlobFileTwo() {
501501
return mockCreateBlob(
502502
"U29tZXRoaW5nIGVsc2U=",
503-
"a71ee6d9405fed4f6fd181c61ceb40ef10905d30"
503+
"a71ee6d9405fed4f6fd181c61ceb40ef10905d30",
504504
);
505505
}
506506

507507
function mockCreateBlobFileThree() {
508508
return mockCreateBlob(
509509
"V2l0aCBzb21lIGNvbnRlbnRz",
510-
"f65b65200aea4fecbe0db6ddac1c0848cdda1d9b"
510+
"f65b65200aea4fecbe0db6ddac1c0848cdda1d9b",
511511
);
512512
}
513513

@@ -518,7 +518,7 @@ function mockCreateBlobFileFour() {
518518
function mockCreateBlobBase64PreEncoded() {
519519
return mockCreateBlob(
520520
"SGVsbG8gV29ybGQ=",
521-
"afb296bb7f3e327767bdda481c4877ba4a09e02e"
521+
"afb296bb7f3e327767bdda481c4877ba4a09e02e",
522522
);
523523
}
524524

@@ -537,7 +537,7 @@ function mockCreateTreeSubmodule(baseTree) {
537537

538538
const m = nock("https://api.github.com").post(
539539
`/repos/${owner}/${repo}/git/trees`,
540-
expectedBody
540+
expectedBody,
541541
);
542542

543543
const body = {
@@ -568,7 +568,7 @@ function mockCreateTree(baseTree) {
568568

569569
const m = nock("https://api.github.com").post(
570570
`/repos/${owner}/${repo}/git/trees`,
571-
expectedBody
571+
expectedBody,
572572
);
573573

574574
const body = {
@@ -593,7 +593,7 @@ function mockCreateTreeSecond(baseTree) {
593593

594594
const m = nock("https://api.github.com").post(
595595
`/repos/${owner}/${repo}/git/trees`,
596-
expectedBody
596+
expectedBody,
597597
);
598598

599599
const body = {
@@ -618,7 +618,7 @@ function mockCreateTreeWithIgnoredDelete(baseTree) {
618618

619619
const m = nock("https://api.github.com").post(
620620
`/repos/${owner}/${repo}/git/trees`,
621-
expectedBody
621+
expectedBody,
622622
);
623623

624624
const body = {
@@ -650,7 +650,7 @@ function mockCreateTreeWithDelete(baseTree) {
650650

651651
const m = nock("https://api.github.com").post(
652652
`/repos/${owner}/${repo}/git/trees`,
653-
expectedBody
653+
expectedBody,
654654
);
655655

656656
const body = {
@@ -669,7 +669,7 @@ function mockCommitSubmodule(baseTree) {
669669

670670
const m = nock("https://api.github.com").post(
671671
`/repos/${owner}/${repo}/git/commits`,
672-
expectedBody
672+
expectedBody,
673673
);
674674

675675
const body = {
@@ -691,7 +691,7 @@ function mockCommit(baseTree, additional) {
691691

692692
const m = nock("https://api.github.com").post(
693693
`/repos/${owner}/${repo}/git/commits`,
694-
expectedBody
694+
expectedBody,
695695
);
696696

697697
const body = {
@@ -710,7 +710,7 @@ function mockCommitSecond(baseTree) {
710710

711711
const m = nock("https://api.github.com").post(
712712
`/repos/${owner}/${repo}/git/commits`,
713-
expectedBody
713+
expectedBody,
714714
);
715715

716716
const body = {
@@ -728,7 +728,7 @@ function mockUpdateRef(branch) {
728728

729729
const m = nock("https://api.github.com").patch(
730730
`/repos/${owner}/${repo}/git/refs/heads%2F${branch}`,
731-
expectedBody
731+
expectedBody,
732732
);
733733

734734
m.reply(200);
@@ -743,7 +743,7 @@ function mockCreateRef(branch, sha) {
743743

744744
const m = nock("https://api.github.com").post(
745745
`/repos/${owner}/${repo}/git/refs`,
746-
expectedBody
746+
expectedBody,
747747
);
748748

749749
m.reply(200);
@@ -758,7 +758,7 @@ function mockCreateRefSecond(branch, sha) {
758758

759759
const m = nock("https://api.github.com").post(
760760
`/repos/${owner}/${repo}/git/refs`,
761-
expectedBody
761+
expectedBody,
762762
);
763763

764764
m.reply(200);
@@ -776,7 +776,7 @@ function mockGetRepo() {
776776

777777
function mockGetContents(fileName, branch, success) {
778778
const m = nock("https://api.github.com").head(
779-
`/repos/${owner}/${repo}/contents/${fileName}?ref=${branch}`
779+
`/repos/${owner}/${repo}/contents/${fileName}?ref=${branch}`,
780780
);
781781

782782
if (success) {

0 commit comments

Comments
 (0)