@@ -34,22 +34,38 @@ test('should return true for revert commits', t => {
34
34
) ;
35
35
} ) ;
36
36
37
- test ( 'should return true for npm version commits' , t => {
38
- t . true ( isIgnored ( `0.0.1` ) ) ;
39
- t . true ( isIgnored ( `0.1.0` ) ) ;
40
- t . true ( isIgnored ( `1.0.0` ) ) ;
41
- t . true ( isIgnored ( `0.0.1-alpha` ) ) ;
42
- t . true ( isIgnored ( `0.0.1-some-crazy-tag` ) ) ;
43
- t . true ( isIgnored ( `0.0.1-0` ) ) ;
44
- t . true ( isIgnored ( `0.0.1-999` ) ) ;
45
- t . true ( isIgnored ( `0.0.1-alpha.0` ) ) ;
46
- t . true ( isIgnored ( `0.0.1-alpha.999` ) ) ;
47
- t . true ( isIgnored ( `0.0.1-some-crazy-tag.0` ) ) ;
48
- t . true ( isIgnored ( `0.0.1-some-crazy-tag.999` ) ) ;
49
- t . true ( isIgnored ( `0.0.1-1e69d54` ) ) ;
50
- t . true ( isIgnored ( `v0.0.1` ) ) ;
51
- t . true ( isIgnored ( ` v3.0.0` ) ) ;
52
- } ) ;
37
+ const versionCommitInputs = [
38
+ '0.0.1' ,
39
+ '0.1.0' ,
40
+ '1.0.0' ,
41
+ '0.0.1-alpha' ,
42
+ '0.0.1-some-crazy-tag' ,
43
+ '0.0.1-0' ,
44
+ '0.0.1-999' ,
45
+ '0.0.1-alpha.0' ,
46
+ '0.0.1-alpha.999' ,
47
+ '0.0.1-some-crazy-tag.0' ,
48
+ '0.0.1-some-crazy-tag.999' ,
49
+ '0.0.1-1e69d54' ,
50
+ 'v0.0.1' ,
51
+ ' v3.0.0'
52
+ ] ;
53
+ for ( let i = 0 , len = versionCommitInputs . length ; i < len ; i ++ ) {
54
+ const input = versionCommitInputs [ i ] ;
55
+ const commitMsg1 = input ;
56
+ const commitMsg2 = `${ input } \n\nSigned-off-by: Developer <[email protected] >` ;
57
+ const commitMsg3 = `${ input } \n\nChange-Id: I895114872a515a269487a683124b63303818e19c` ;
58
+ const commitMsg4 = `${ input } \n\nSigned-off-by: Developer <[email protected] >\nChange-Id: I895114872a515a269487a683124b63303818e19c` ;
59
+
60
+ console . log ( commitMsg1 , commitMsg2 , commitMsg3 , commitMsg4 ) ;
61
+
62
+ test ( `should return true for version commit permutations of '${ input } '` , t => {
63
+ t . true ( isIgnored ( commitMsg1 ) ) ;
64
+ t . true ( isIgnored ( commitMsg2 ) ) ;
65
+ t . true ( isIgnored ( commitMsg3 ) ) ;
66
+ t . true ( isIgnored ( commitMsg4 ) ) ;
67
+ } ) ;
68
+ }
53
69
54
70
test ( 'should return true fixup commits' , t => {
55
71
t . true ( isIgnored ( 'fixup! initial commit' ) ) ;
0 commit comments