Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(core): demo references in header being dropped #116

Closed
wants to merge 1 commit into from
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);
});