@@ -2,11 +2,11 @@ const validatePrTitle = require('./validatePrTitle');
2
2
3
3
it ( 'allows valid PR titles that use the default types' , async ( ) => {
4
4
const inputs = [
5
- 'fix: Fix bug' ,
6
- 'fix!: Fix bug' ,
7
- 'feat: Add feature' ,
8
- 'feat!: Add feature' ,
9
- 'refactor: Internal cleanup'
5
+ 'fix: fix bug' ,
6
+ 'fix!: fix bug' ,
7
+ 'feat: add feature' ,
8
+ 'feat!: add feature' ,
9
+ 'refactor: internal cleanup'
10
10
] ;
11
11
12
12
for ( let index = 0 ; index < inputs . length ; index ++ ) {
@@ -40,15 +40,15 @@ it('throws for PR titles with an unknown type', async () => {
40
40
41
41
describe ( 'defined scopes' , ( ) => {
42
42
it ( 'allows a missing scope by default' , async ( ) => {
43
- await validatePrTitle ( 'fix: Bar ' ) ;
43
+ await validatePrTitle ( 'fix: bar ' ) ;
44
44
} ) ;
45
45
46
46
it ( 'allows all scopes by default' , async ( ) => {
47
47
await validatePrTitle ( 'fix(core): Bar' ) ;
48
48
} ) ;
49
49
50
50
it ( 'allows a missing scope when custom scopes are defined' , async ( ) => {
51
- await validatePrTitle ( 'fix: Bar ' , { scopes : [ 'foo' ] } ) ;
51
+ await validatePrTitle ( 'fix: bar ' , { scopes : [ 'foo' ] } ) ;
52
52
} ) ;
53
53
54
54
it ( 'allows a matching scope' , async ( ) => {
@@ -132,12 +132,12 @@ describe('defined scopes', () => {
132
132
133
133
it ( 'throws when a scope is missing' , async ( ) => {
134
134
await expect (
135
- validatePrTitle ( 'fix: Bar ' , {
135
+ validatePrTitle ( 'fix: bar ' , {
136
136
scopes : [ 'foo' , 'bar' ] ,
137
137
requireScope : true
138
138
} )
139
139
) . rejects . toThrow (
140
- 'No scope found in pull request title "fix: Bar ". Scope must match one of: foo, bar.'
140
+ 'No scope found in pull request title "fix: bar ". Scope must match one of: foo, bar.'
141
141
) ;
142
142
} ) ;
143
143
} ) ;
@@ -253,12 +253,12 @@ describe('defined scopes', () => {
253
253
254
254
it ( 'throws when a scope is missing' , async ( ) => {
255
255
await expect (
256
- validatePrTitle ( 'fix: Bar ' , {
256
+ validatePrTitle ( 'fix: bar ' , {
257
257
requireScope : true
258
258
} )
259
259
) . rejects . toThrow (
260
260
// Should make no mention of any available scope
261
- / ^ N o s c o p e f o u n d i n p u l l r e q u e s t t i t l e " f i x : B a r " .$ /
261
+ / ^ N o s c o p e f o u n d i n p u l l r e q u e s t t i t l e " f i x : b a r " .$ /
262
262
) ;
263
263
} ) ;
264
264
} ) ;
@@ -277,9 +277,9 @@ describe('custom types', () => {
277
277
278
278
it ( 'throws for PR titles with an unknown type' , async ( ) => {
279
279
await expect (
280
- validatePrTitle ( 'fix: Foobar ' , { types : [ 'foo' , 'bar' ] } )
280
+ validatePrTitle ( 'fix: foobar ' , { types : [ 'foo' , 'bar' ] } )
281
281
) . rejects . toThrow (
282
- 'Unknown release type "fix" found in pull request title "fix: Foobar ".'
282
+ 'Unknown release type "fix" found in pull request title "fix: foobar ".'
283
283
) ;
284
284
} ) ;
285
285
} ) ;
@@ -332,11 +332,11 @@ describe('description validation', () => {
332
332
333
333
it ( 'throws for only partial matches' , async ( ) => {
334
334
await expect (
335
- validatePrTitle ( 'fix: Foobar ' , {
336
- subjectPattern : 'Foo '
335
+ validatePrTitle ( 'fix: foobar ' , {
336
+ subjectPattern : 'foo '
337
337
} )
338
338
) . rejects . toThrow (
339
- 'The subject "Foobar " found in pull request title "fix: Foobar " isn\'t an exact match for the configured pattern "Foo ". Please provide a subject that matches the whole pattern exactly.'
339
+ 'The subject "foobar " found in pull request title "fix: foobar " isn\'t an exact match for the configured pattern "foo ". Please provide a subject that matches the whole pattern exactly.'
340
340
) ;
341
341
} ) ;
342
342
0 commit comments