Skip to content

Commit d3d84fa

Browse files
committed
Renamed reOrderBumpAndLocalizationCommit to reOrderBumpCommit
1 parent 43a78ac commit d3d84fa

File tree

6 files changed

+29
-37
lines changed

6 files changed

+29
-37
lines changed

specs/command.spec.js

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ v17.11.2`)
284284
});
285285
});
286286

287-
describe("reOrderBumpAndLocalizationCommits", () => {
287+
describe("reOrderBumpCommit", () => {
288288
let joinSpy;
289289
beforeEach(() => {
290290
joinSpy = jest
@@ -293,7 +293,7 @@ v17.11.2`)
293293
});
294294

295295
it("should call 'runCommand' with appropriate arguments", () => {
296-
return command.reOrderBumpAndLocalizationCommits().then(() => {
296+
return command.reOrderBumpCommit().then(() => {
297297
expect(runCommand).toHaveBeenCalledTimes(1);
298298
expect(runCommand).toHaveBeenCalledWith({
299299
args:
@@ -307,20 +307,18 @@ v17.11.2`)
307307
});
308308

309309
it("should pass onError to 'runCommand'", () => {
310-
return command
311-
.reOrderBumpAndLocalizationCommits({ onError })
312-
.then(() => {
313-
expect(runCommand).toHaveBeenCalledTimes(1);
314-
expect(runCommand).toHaveBeenCalledWith({
315-
args:
316-
'GIT_SEQUENCE_EDITOR="cat my_path/ >" git rebase -i upstream/master',
317-
failHelpKey: "gitRebaseInteractive",
318-
fullCommand: true,
319-
logMessage: "Reordering bump commit",
320-
exitOnFail: true,
321-
onError
322-
});
310+
return command.reOrderBumpCommit({ onError }).then(() => {
311+
expect(runCommand).toHaveBeenCalledTimes(1);
312+
expect(runCommand).toHaveBeenCalledWith({
313+
args:
314+
'GIT_SEQUENCE_EDITOR="cat my_path/ >" git rebase -i upstream/master',
315+
failHelpKey: "gitRebaseInteractive",
316+
fullCommand: true,
317+
logMessage: "Reordering bump commit",
318+
exitOnFail: true,
319+
onError
323320
});
321+
});
324322
});
325323

326324
afterEach(() => {

specs/workflows/pr.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe("pr workflows", () => {
2222
run.saveState,
2323
run.checkIfReOrderNeeded,
2424
run.reOrderLatestCommits,
25-
run.reOrderBumpAndLocalizationCommits,
25+
run.reOrderBumpCommit,
2626
run.getReposFromBumpCommit,
2727
run.verifyPackagesToPromote,
2828
run.getCurrentDependencyVersions,

specs/workflows/steps/index.spec.js

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2019,34 +2019,28 @@ describe("shared workflow steps", () => {
20192019
});
20202020
});
20212021

2022-
describe("reOrderBumpAndLocalizationCommits", () => {
2022+
describe("reOrderBumpCommit", () => {
20232023
it("should resolve if reOrder is false", () => {
20242024
state.reOrder = false;
2025-
return run.reOrderBumpAndLocalizationCommits(state).then(() => {
2026-
expect(
2027-
command.reOrderBumpAndLocalizationCommits
2028-
).not.toHaveBeenCalled();
2025+
return run.reOrderBumpCommit(state).then(() => {
2026+
expect(command.reOrderBumpCommit).not.toHaveBeenCalled();
20292027
});
20302028
});
20312029

2032-
it("should call 'command.reOrderBumpAndLocalizationCommits' if reOrder is true", () => {
2030+
it("should call 'command.reOrderBumpCommit' if reOrder is true", () => {
20332031
state.reOrder = true;
2034-
command.reOrderBumpAndLocalizationCommits = jest.fn(() =>
2035-
Promise.resolve()
2036-
);
2037-
return run.reOrderBumpAndLocalizationCommits(state).then(() => {
2038-
expect(
2039-
command.reOrderBumpAndLocalizationCommits
2040-
).toHaveBeenCalledTimes(1);
2032+
command.reOrderBumpCommit = jest.fn(() => Promise.resolve());
2033+
return run.reOrderBumpCommit(state).then(() => {
2034+
expect(command.reOrderBumpCommit).toHaveBeenCalledTimes(1);
20412035
});
20422036
});
20432037

2044-
it("should call onError when `command.reOrderBumpAndLocalizationCommits` fails", () => {
2038+
it("should call onError when `command.reOrderBumpCommit` fails", () => {
20452039
state.reOrder = true;
2046-
command.reOrderBumpAndLocalizationCommits = jest.fn(args => {
2040+
command.reOrderBumpCommit = jest.fn(args => {
20472041
return args.onError();
20482042
});
2049-
return run.reOrderBumpAndLocalizationCommits(state).catch(() => {
2043+
return run.reOrderBumpCommit(state).catch(() => {
20502044
expect(util.advise).toHaveBeenCalledTimes(1);
20512045
expect(util.advise).toHaveBeenCalledWith("reOrderFail");
20522046
});

src/command.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ const command = {
338338
});
339339
},
340340

341-
reOrderBumpAndLocalizationCommits({ onError } = {}) {
341+
reOrderBumpCommit({ onError } = {}) {
342342
const args = `GIT_SEQUENCE_EDITOR="cat ${path.join(
343343
__dirname,
344344
".reordered-commits.txt"

src/workflows/pr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = {
1414
run.saveState,
1515
run.checkIfReOrderNeeded,
1616
run.reOrderLatestCommits,
17-
run.reOrderBumpAndLocalizationCommits,
17+
run.reOrderBumpCommit,
1818
run.getReposFromBumpCommit,
1919
run.verifyPackagesToPromote,
2020
run.getCurrentDependencyVersions,

src/workflows/steps/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -745,8 +745,8 @@ ${chalk.green(log)}`);
745745
state.reOrder = result;
746746
});
747747
},
748-
reOrderBumpAndLocalizationCommits(state) {
749-
state.step = "reOrderBumpAndLocalizationCommits";
748+
reOrderBumpCommit(state) {
749+
state.step = "reOrderBumpCommit";
750750

751751
if (!state.reOrder) {
752752
return Promise.resolve();
@@ -757,7 +757,7 @@ ${chalk.green(log)}`);
757757
return Promise.reject();
758758
};
759759

760-
return command.reOrderBumpAndLocalizationCommits({ onError });
760+
return command.reOrderBumpCommit({ onError });
761761
},
762762
gitRebaseUpstreamMaster(state) {
763763
state.step = "gitRebaseUpstreamMaster";

0 commit comments

Comments
 (0)