@@ -107,7 +107,12 @@ test('supports scopes with /', async t => {
107
107
108
108
test ( 'ignores comments' , async t => {
109
109
const message = 'type(some/scope): subject\n# some comment' ;
110
- const actual = await parse ( message ) ;
110
+ const changelogOpts = await importFrom (
111
+ process . cwd ( ) ,
112
+ 'conventional-changelog-angular'
113
+ ) ;
114
+ const opts = Object . assign ( { } , changelogOpts . parserOpts , { commentChar : '#' } ) ;
115
+ const actual = await parse ( message , undefined , opts ) ;
111
116
t . is ( actual . body , null ) ;
112
117
t . is ( actual . footer , null ) ;
113
118
t . is ( actual . subject , 'subject' ) ;
@@ -116,7 +121,22 @@ test('ignores comments', async t => {
116
121
test ( 'registers inline #' , async t => {
117
122
const message =
118
123
'type(some/scope): subject #reference\n# some comment\nthings #reference' ;
119
- const actual = await parse ( message ) ;
124
+ const changelogOpts = await importFrom (
125
+ process . cwd ( ) ,
126
+ 'conventional-changelog-angular'
127
+ ) ;
128
+ const opts = Object . assign ( { } , changelogOpts . parserOpts , { commentChar : '#' } ) ;
129
+ const actual = await parse ( message , undefined , opts ) ;
120
130
t . is ( actual . subject , 'subject #reference' ) ;
121
131
t . is ( actual . body , 'things #reference' ) ;
122
132
} ) ;
133
+
134
+ test ( 'parses references leading subject' , async t => {
135
+ const message = '#1 some subject' ;
136
+ const opts = await importFrom (
137
+ process . cwd ( ) ,
138
+ 'conventional-changelog-angular'
139
+ ) ;
140
+ const { references : [ actual ] } = await parse ( message , undefined , opts ) ;
141
+ t . is ( actual . issue , '1' ) ;
142
+ } ) ;
0 commit comments