feat(issue-17): override backporting pr data (#29)

This commit is contained in:
Andrea Lamparelli 2023-06-20 22:29:52 +02:00 committed by GitHub
parent 1732481b37
commit 941beda208
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 279 additions and 30 deletions

View file

@ -28,6 +28,10 @@ describe("cli args parser", () => {
expect(args.folder).toEqual(undefined);
expect(args.targetBranch).toEqual("target");
expect(args.pullRequest).toEqual("https://localhost/whatever/pulls/1");
expect(args.title).toEqual(undefined);
expect(args.body).toEqual(undefined);
expect(args.bodyPrefix).toEqual(undefined);
expect(args.bpBranchName).toEqual(undefined);
});
test("valid execution [default, long]", () => {
@ -45,6 +49,10 @@ describe("cli args parser", () => {
expect(args.folder).toEqual(undefined);
expect(args.targetBranch).toEqual("target");
expect(args.pullRequest).toEqual("https://localhost/whatever/pulls/1");
expect(args.title).toEqual(undefined);
expect(args.body).toEqual(undefined);
expect(args.bodyPrefix).toEqual(undefined);
expect(args.bpBranchName).toEqual(undefined);
});
test("valid execution [override, short]", () => {
@ -65,6 +73,10 @@ describe("cli args parser", () => {
expect(args.folder).toEqual(undefined);
expect(args.targetBranch).toEqual("target");
expect(args.pullRequest).toEqual("https://localhost/whatever/pulls/1");
expect(args.title).toEqual(undefined);
expect(args.body).toEqual(undefined);
expect(args.bodyPrefix).toEqual(undefined);
expect(args.bpBranchName).toEqual(undefined);
});
test("valid execution [override, long]", () => {
@ -75,7 +87,15 @@ describe("cli args parser", () => {
"--target-branch",
"target",
"--pull-request",
"https://localhost/whatever/pulls/1"
"https://localhost/whatever/pulls/1",
"--title",
"New Title",
"--body",
"New Body",
"--body-prefix",
"New Body Prefix",
"--bp-branch-name",
"bp_branch_name",
]);
const args: Args = parser.parse();
@ -85,6 +105,10 @@ describe("cli args parser", () => {
expect(args.folder).toEqual(undefined);
expect(args.targetBranch).toEqual("target");
expect(args.pullRequest).toEqual("https://localhost/whatever/pulls/1");
expect(args.title).toEqual("New Title");
expect(args.body).toEqual("New Body");
expect(args.bodyPrefix).toEqual("New Body Prefix");
expect(args.bpBranchName).toEqual("bp_branch_name");
});
});