Skip to content

Commit

Permalink
test: add isse prefix case
Browse files Browse the repository at this point in the history
  • Loading branch information
marionebl committed Dec 26, 2017
1 parent 4808ad2 commit 11674b4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions @commitlint/parse/src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,20 @@ test('parses references leading subject', async t => {
const {references: [actual]} = await parse(message, undefined, opts);
t.is(actual.issue, '1');
});

test('parses custom references', async t => {
const message = '#1 some subject PREFIX-2';
const {references} = await parse(message, undefined, {
issuePrefixes: ['PREFIX-']
});

t.falsy(references.find(ref => ref.issue === '1'));
t.deepEqual(references.find(ref => ref.issue === '2'), {
action: null,
issue: '2',
owner: null,
prefix: 'PREFIX-',
raw: '#1 some subject PREFIX-2',
repository: null
});
});

0 comments on commit 11674b4

Please sign in to comment.