@@ -82,8 +82,9 @@ describe("ReleaseOps", () => {
82
82
83
83
it ( "should create a patch release when only bug fixes are present" , ( ) => {
84
84
const logs = [
85
- "* 5b4812a956935358bf6e48f4d75a9bc998b3fe41 Fix: Something (Foo Bar)" ,
86
- "* 00a3526f3a6560e4f91d390725b9a70f5d974f89 Docs: Something else (foobar)" ,
85
+ "* 5b4812a956935358bf6e48f4d75a9bc998b3fe41 fix: Something (Foo Bar)" ,
86
+ "* 00b3526f3a6560e4f91d390725b9a70f5d974f80 docs: Something else (foobar)" ,
87
+ "* 00a3526f3a6560e4f91d390725b9a70f5d974f80 Docs: Something else (foobar)" ,
87
88
"* 24b2fdb310b89d7aad134df7e8863a5e055ac63f Fix: Something else (Foo B. Baz)"
88
89
] ,
89
90
releaseInfo = ReleaseOps . calculateReleaseFromGitLogs ( "1.0.0" , logs ) ;
@@ -93,16 +94,18 @@ describe("ReleaseOps", () => {
93
94
type : "patch" ,
94
95
changelog : {
95
96
fix : [
96
- "* [`5b4812a`](https://github.com/eslint/eslint-release/commit/5b4812a956935358bf6e48f4d75a9bc998b3fe41) Fix : Something (Foo Bar)" ,
97
+ "* [`5b4812a`](https://github.com/eslint/eslint-release/commit/5b4812a956935358bf6e48f4d75a9bc998b3fe41) fix : Something (Foo Bar)" ,
97
98
"* [`24b2fdb`](https://github.com/eslint/eslint-release/commit/24b2fdb310b89d7aad134df7e8863a5e055ac63f) Fix: Something else (Foo B. Baz)"
98
99
] ,
99
100
docs : [
100
- "* [`00a3526`](https://github.com/eslint/eslint-release/commit/00a3526f3a6560e4f91d390725b9a70f5d974f89) Docs: Something else (foobar)"
101
+ "* [`00b3526`](https://github.com/eslint/eslint-release/commit/00b3526f3a6560e4f91d390725b9a70f5d974f80) docs: Something else (foobar)" ,
102
+ "* [`00a3526`](https://github.com/eslint/eslint-release/commit/00a3526f3a6560e4f91d390725b9a70f5d974f80) Docs: Something else (foobar)"
101
103
]
102
104
} ,
103
105
rawChangelog : [
104
- "* [`5b4812a`](https://github.com/eslint/eslint-release/commit/5b4812a956935358bf6e48f4d75a9bc998b3fe41) Fix: Something (Foo Bar)" ,
105
- "* [`00a3526`](https://github.com/eslint/eslint-release/commit/00a3526f3a6560e4f91d390725b9a70f5d974f89) Docs: Something else (foobar)" ,
106
+ "* [`5b4812a`](https://github.com/eslint/eslint-release/commit/5b4812a956935358bf6e48f4d75a9bc998b3fe41) fix: Something (Foo Bar)" ,
107
+ "* [`00b3526`](https://github.com/eslint/eslint-release/commit/00b3526f3a6560e4f91d390725b9a70f5d974f80) docs: Something else (foobar)" ,
108
+ "* [`00a3526`](https://github.com/eslint/eslint-release/commit/00a3526f3a6560e4f91d390725b9a70f5d974f80) Docs: Something else (foobar)" ,
106
109
"* [`24b2fdb`](https://github.com/eslint/eslint-release/commit/24b2fdb310b89d7aad134df7e8863a5e055ac63f) Fix: Something else (Foo B. Baz)"
107
110
] . join ( "\n" )
108
111
} ) ;
@@ -141,6 +144,39 @@ describe("ReleaseOps", () => {
141
144
} ) ;
142
145
} ) ;
143
146
147
+ it ( "should create a minor release when conventional enhancements are present" , ( ) => {
148
+ const logs = [
149
+ "* 34d6f550b2c87e61a70cb201abd3eadebb370453 fix: Something (Author Name)" ,
150
+ "* 5c5c361cc338d284cac6d170ab7e105e213e1307 docs: Something else (authorname)" ,
151
+ "* bcdc618488d12184e32a7ba170b443450c3e9e48 fix: Something else (First Last)" ,
152
+ "* 7e4ffad5c91e4f8a99a95955ec65c5dbe9ae1758 feat: Foo (dotstar)"
153
+ ] ,
154
+ releaseInfo = ReleaseOps . calculateReleaseFromGitLogs ( "1.0.0" , logs ) ;
155
+
156
+ assert . deepStrictEqual ( releaseInfo , {
157
+ version : "1.1.0" ,
158
+ type : "minor" ,
159
+ changelog : {
160
+ fix : [
161
+ "* [`34d6f55`](https://github.com/eslint/eslint-release/commit/34d6f550b2c87e61a70cb201abd3eadebb370453) fix: Something (Author Name)" ,
162
+ "* [`bcdc618`](https://github.com/eslint/eslint-release/commit/bcdc618488d12184e32a7ba170b443450c3e9e48) fix: Something else (First Last)"
163
+ ] ,
164
+ docs : [
165
+ "* [`5c5c361`](https://github.com/eslint/eslint-release/commit/5c5c361cc338d284cac6d170ab7e105e213e1307) docs: Something else (authorname)"
166
+ ] ,
167
+ new : [
168
+ "* [`7e4ffad`](https://github.com/eslint/eslint-release/commit/7e4ffad5c91e4f8a99a95955ec65c5dbe9ae1758) feat: Foo (dotstar)"
169
+ ]
170
+ } ,
171
+ rawChangelog : [
172
+ "* [`34d6f55`](https://github.com/eslint/eslint-release/commit/34d6f550b2c87e61a70cb201abd3eadebb370453) fix: Something (Author Name)" ,
173
+ "* [`5c5c361`](https://github.com/eslint/eslint-release/commit/5c5c361cc338d284cac6d170ab7e105e213e1307) docs: Something else (authorname)" ,
174
+ "* [`bcdc618`](https://github.com/eslint/eslint-release/commit/bcdc618488d12184e32a7ba170b443450c3e9e48) fix: Something else (First Last)" ,
175
+ "* [`7e4ffad`](https://github.com/eslint/eslint-release/commit/7e4ffad5c91e4f8a99a95955ec65c5dbe9ae1758) feat: Foo (dotstar)"
176
+ ] . join ( "\n" )
177
+ } ) ;
178
+ } ) ;
179
+
144
180
it ( "should create a major release when breaking changes are present" , ( ) => {
145
181
const logs = [
146
182
"* 34d6f550b2c87e61a70cb201abd3eadebb370453 Fix: Something (githubhandle)" ,
@@ -179,6 +215,44 @@ describe("ReleaseOps", () => {
179
215
} ) ;
180
216
} ) ;
181
217
218
+ it ( "should create a major release when conventional breaking changes are present" , ( ) => {
219
+ const logs = [
220
+ "* 34d6f550b2c87e61a70cb201abd3eadebb370453 fix: Something (githubhandle)" ,
221
+ "* 5c5c361cc338d284cac6d170ab7e105e213e1307 docs: Something else (Committer Name)" ,
222
+ "* bcdc618488d12184e32a7ba170b443450c3e9e48 fix: Something else (Abc D. Efg)" ,
223
+ "* 7e4ffad5c91e4f8a99a95955ec65c5dbe9ae1758 feat: Foo (Tina Tester)" ,
224
+ "* 00a3526f3a6560e4f91d390725b9a70f5d974f89 feat!: Whatever (Toby Testing)"
225
+ ] ,
226
+ releaseInfo = ReleaseOps . calculateReleaseFromGitLogs ( "1.0.0" , logs ) ;
227
+
228
+ assert . deepStrictEqual ( releaseInfo , {
229
+ version : "2.0.0" ,
230
+ type : "major" ,
231
+ changelog : {
232
+ fix : [
233
+ "* [`34d6f55`](https://github.com/eslint/eslint-release/commit/34d6f550b2c87e61a70cb201abd3eadebb370453) fix: Something (githubhandle)" ,
234
+ "* [`bcdc618`](https://github.com/eslint/eslint-release/commit/bcdc618488d12184e32a7ba170b443450c3e9e48) fix: Something else (Abc D. Efg)"
235
+ ] ,
236
+ docs : [
237
+ "* [`5c5c361`](https://github.com/eslint/eslint-release/commit/5c5c361cc338d284cac6d170ab7e105e213e1307) docs: Something else (Committer Name)"
238
+ ] ,
239
+ new : [
240
+ "* [`7e4ffad`](https://github.com/eslint/eslint-release/commit/7e4ffad5c91e4f8a99a95955ec65c5dbe9ae1758) feat: Foo (Tina Tester)"
241
+ ] ,
242
+ breaking : [
243
+ "* [`00a3526`](https://github.com/eslint/eslint-release/commit/00a3526f3a6560e4f91d390725b9a70f5d974f89) feat!: Whatever (Toby Testing)"
244
+ ]
245
+ } ,
246
+ rawChangelog : [
247
+ "* [`34d6f55`](https://github.com/eslint/eslint-release/commit/34d6f550b2c87e61a70cb201abd3eadebb370453) fix: Something (githubhandle)" ,
248
+ "* [`5c5c361`](https://github.com/eslint/eslint-release/commit/5c5c361cc338d284cac6d170ab7e105e213e1307) docs: Something else (Committer Name)" ,
249
+ "* [`bcdc618`](https://github.com/eslint/eslint-release/commit/bcdc618488d12184e32a7ba170b443450c3e9e48) fix: Something else (Abc D. Efg)" ,
250
+ "* [`7e4ffad`](https://github.com/eslint/eslint-release/commit/7e4ffad5c91e4f8a99a95955ec65c5dbe9ae1758) feat: Foo (Tina Tester)" ,
251
+ "* [`00a3526`](https://github.com/eslint/eslint-release/commit/00a3526f3a6560e4f91d390725b9a70f5d974f89) feat!: Whatever (Toby Testing)"
252
+ ] . join ( "\n" )
253
+ } ) ;
254
+ } ) ;
255
+
182
256
it ( "should disregard reverted commits and sponsor syncs" , ( ) => {
183
257
const logs = [
184
258
"* 34d6f550b2c87e61a70cb201abd3eadebb370453 Docs: Update something in the docs (githubhandle)" ,
0 commit comments