Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions @commitlint/core/src/rules/references-empty.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ const messages = {
plain: 'foo: bar',
comment: 'foo: baz\n#1 Comment',
reference: '#comment\nfoo: baz \nCloses #1',
references: '#comment\nfoo: bar \nCloses #1, #2, #3'
references: '#comment\nfoo: bar \nCloses #1, #2, #3',
issue: 'foo: bar #1'
};

const parsed = {
plain: parse(messages.plain),
comment: parse(messages.comment),
reference: parse(messages.reference),
references: parse(messages.references)
references: parse(messages.references),
issue: parse(messages.issue)
};

test('defaults to never and fails for plain', async t => {
Expand Down Expand Up @@ -63,3 +65,15 @@ test('fails for references with always', async t => {
const expected = false;
t.is(actual, expected);
});

test.failing('succeeds for issue with never', async t => {
const [actual] = referencesEmpty(await parsed.issue, 'never');
const expected = true;
t.is(actual, expected);
});

test.failing('fails for issue with always', async t => {
const [actual] = referencesEmpty(await parsed.issue, 'always');
const expected = false;
t.is(actual, expected);
});