-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: keep co-authors in spread commit (#410)
- Loading branch information
Showing
3 changed files
with
38 additions
and
25 deletions.
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 |
---|---|---|
|
@@ -20,17 +20,32 @@ describe('gitCommit', () => { | |
}); | ||
|
||
it('commits with co-author', () => { | ||
// This reflects how it can be retrieved from git commands. | ||
const author = `Co-authored-by: them <[email protected]> | ||
`.trim(); | ||
const coAuthors = ` | ||
Co-authored-by: me <[email protected]> | ||
Co-authored-by: you <[email protected]> | ||
` | ||
.split('\n') | ||
.map((coAuthor) => coAuthor.trim()) | ||
.filter(Boolean); | ||
|
||
gitCommit({ | ||
message: 'chore: does something', | ||
coauthor: { name: 'some', email: '[email protected]' }, | ||
coAuthors: [author, ...coAuthors], | ||
}); | ||
expect(execa).toHaveBeenCalledTimes(1); | ||
expect(execa).toHaveBeenCalledWith( | ||
'git', | ||
[ | ||
'commit', | ||
'-m', | ||
'chore: does something\n\n\nCo-authored-by: some <random@person.com>', | ||
'chore: does something\n\n\nCo-authored-by: them <[email protected]>\nCo-authored-by: me <[email protected]>\nCo-authored-by: you <you@algolia.com>', | ||
], | ||
{ cwd: expect.any(String) } | ||
); | ||
|
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
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