From 74c6d7cbfa51109f796dcd3b8fc545cf6ef71843 Mon Sep 17 00:00:00 2001 From: ryoya ito <110ryoya@gmail.com> Date: Fri, 26 Feb 2021 22:42:18 +0900 Subject: [PATCH] add test case of multiple slackUsernames --- __tests__/utils.test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/__tests__/utils.test.ts b/__tests__/utils.test.ts index 95fa8f3..d0c5d9b 100644 --- a/__tests__/utils.test.ts +++ b/__tests__/utils.test.ts @@ -51,5 +51,18 @@ describe('utils test', () => { ) expect(result).toBe('`@ry-itto`') }) + + it('multiple slackUsernames', () => { + const slackUsernames = ` + ry-itto,ito ryoya + github,octocat + ` + const body = 'ry-itto and github' + const result = replaceGitHubUsernameWithSlackUsername( + body, + slackUsernames + ) + expect(result).toBe('<@ito ryoya> and <@octocat>') + }) }) })