Skip to content

Commit

Permalink
test: add case for #399
Browse files Browse the repository at this point in the history
  • Loading branch information
marionebl committed Nov 30, 2018
1 parent fa7aedb commit a4397af
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion @commitlint/parse/src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,23 @@ test('uses restrictive default regex in passed parser opts', async t => {
});

t.is(actual.subject, null);
t.is(actual.message, undefined);
t.is(actual.scope, null);
});

test('works with chinese scope by default', async t => {
const message = 'fix(面试评价): 测试';
const actual = await parse(message, undefined, {commentChar: '#'});

t.not(actual.subject, null);
t.not(actual.scope, null);
});

test('does not work with chinese scopes with incompatible pattern', async t => {
const message = 'fix(面试评价): 测试';
const actual = await parse(message, undefined, {
headerPattern: /^(\w*)(?:\(([a-z]*)\))?: (.*)$/
});

t.is(actual.subject, null);
t.is(actual.scope, null);
});

0 comments on commit a4397af

Please sign in to comment.