Skip to content

Commit

Permalink
Merge pull request #870 from mikepenz/develop
Browse files Browse the repository at this point in the history
dev -> main
  • Loading branch information
mikepenz authored Aug 16, 2022
2 parents 8949851 + 1bd2463 commit 000e446
Show file tree
Hide file tree
Showing 7 changed files with 316 additions and 380 deletions.
22 changes: 19 additions & 3 deletions __tests__/transform.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -597,11 +597,27 @@ it('Extract custom placeholder from PR body and replace in global template', asy
pattern: '.+ b(....).+',
target: '\n- $1'
}
},
{
name: 'C_PLACEHOLER_3',
source: 'BODY',
transformer: {
pattern: '.+(body1).+',
target: '$1'
}
},
{
name: 'C_PLACEHOLER_4',
source: 'BODY',
transformer: {
pattern: '.+(body-never-matches).+',
target: '$1'
}
}
]
customConfig.template =
'${{CHANGELOG}}\n\n${{C_PLACEHOLER_2[2]}}\n\n${{C_PLACEHOLER_2[*]}}${{C_PLACEHOLDER_1[7]}}${{C_PLACEHOLER_2[1493]}}'
customConfig.pr_template = '${{BODY}} ----> ${{C_PLACEHOLDER_1}}'
'${{CHANGELOG}}\n\n${{C_PLACEHOLER_2[2]}}\n\n${{C_PLACEHOLER_2[*]}}${{C_PLACEHOLDER_1[7]}}${{C_PLACEHOLER_2[1493]}}${{C_PLACEHOLER_4[*]}}${{C_PLACEHOLER_4[0]}}${{C_PLACEHOLER_3[1]}}'
customConfig.pr_template = '${{BODY}} ----> ${{C_PLACEHOLDER_1}}${{C_PLACEHOLER_3}}'

const resultChangelog = buildChangelog(DefaultDiffInfo, mergedPullRequests, {
owner: 'mikepenz',
Expand All @@ -617,6 +633,6 @@ it('Extract custom placeholder from PR body and replace in global template', asy
})

expect(resultChangelog).toStrictEqual(
`## 🚀 Features\n\nno magic body1 for this matter ----> - body1\nno magic body3 for this matter ----> - body3\n\n## 🐛 Fixes\n\nno magic body2 for this matter ----> - body2\nno magic body3 for this matter ----> - body3\n\n## 🧪 Others\n\nno magic body4 for this matter ----> - body4\n\n\n\n\n- ody3\n\n\n- ody1\n- ody2\n- ody3\n- ody4`
`## 🚀 Features\n\nno magic body1 for this matter ----> - body1body1\nno magic body3 for this matter ----> - body3\n\n## 🐛 Fixes\n\nno magic body2 for this matter ----> - body2\nno magic body3 for this matter ----> - body3\n\n## 🧪 Others\n\nno magic body4 for this matter ----> - body4\n\n\n\n\n- ody3\n\n\n- ody1\n- ody2\n- ody3\n- ody4`
)
})
28 changes: 18 additions & 10 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 000e446

Please sign in to comment.