-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pick target branch from first commit's suggestedTargetBranches in non…
…-interactive mode (#493)
- Loading branch information
Showing
2 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -193,6 +193,49 @@ describe('getTargetBranches', () => { | |
}); | ||
}); | ||
}); | ||
|
||
describe('when `commit.suggestedTargetBranches` is not empty and non-interactive mode', () => { | ||
let branches: string[]; | ||
|
||
beforeEach(async () => { | ||
const options = { | ||
interactive: false, | ||
} as ValidConfigOptions; | ||
|
||
const commits: Commit[] = [ | ||
{ | ||
author: { email: '[email protected]', name: 'Søren Louv-Jansen' }, | ||
sourceCommit: { | ||
branchLabelMapping: {}, | ||
committedDate: 'aaa', | ||
message: 'hey', | ||
sha: 'abcd', | ||
}, | ||
sourceBranch: '7.x', | ||
suggestedTargetBranches: ['release/targetBranch'], | ||
targetPullRequestStates: [], | ||
}, | ||
{ | ||
author: { email: '[email protected]', name: 'Søren Louv-Jansen' }, | ||
sourceCommit: { | ||
branchLabelMapping: {}, | ||
committedDate: 'aaa', | ||
message: 'hey', | ||
sha: 'abcd', | ||
}, | ||
sourceBranch: '7.x', | ||
suggestedTargetBranches: ['release/targetBranch'], | ||
targetPullRequestStates: [], | ||
}, | ||
]; | ||
|
||
branches = await getTargetBranches(options, commits); | ||
}); | ||
|
||
it('should return branches from commit', () => { | ||
expect(branches).toEqual(['release/targetBranch']); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('getTargetBranchChoices', () => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters