Skip to content

Commit 11674b4

Browse files
committed
test: add isse prefix case
1 parent 4808ad2 commit 11674b4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

@commitlint/parse/src/index.test.js

+17
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,20 @@ test('parses references leading subject', async t => {
140140
const {references: [actual]} = await parse(message, undefined, opts);
141141
t.is(actual.issue, '1');
142142
});
143+
144+
test('parses custom references', async t => {
145+
const message = '#1 some subject PREFIX-2';
146+
const {references} = await parse(message, undefined, {
147+
issuePrefixes: ['PREFIX-']
148+
});
149+
150+
t.falsy(references.find(ref => ref.issue === '1'));
151+
t.deepEqual(references.find(ref => ref.issue === '2'), {
152+
action: null,
153+
issue: '2',
154+
owner: null,
155+
prefix: 'PREFIX-',
156+
raw: '#1 some subject PREFIX-2',
157+
repository: null
158+
});
159+
});

0 commit comments

Comments
 (0)