Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .sgcrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"scope": false,
"body": true,
"emoji": false,
"lowercaseTypes": false,
"initial-commit": {
"isEnabled": true,
"emoji": ":tada:",
Expand Down
2 changes: 1 addition & 1 deletion lib/questions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const choices = (config) => {

config.types.forEach((type) => {
const emoji = config.emoji && type.emoji ? `${type.emoji} ` : '';
const configType = type.type;
const configType = config.lowercaseTypes ? type.type.toLowerCase() : type.type;
const description = type.description || '';

choicesList.push({
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/.sgcrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"scope": false,
"body": true,
"emoji": false,
"lowercaseTypes": false,
"initial-commit": {
"isEnabled": true,
"emoji": ":tada:",
Expand Down
18 changes: 18 additions & 0 deletions test/questions.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,24 @@ test('check the values of the question object', (t) => {
t.is(typeof questionsList, 'object');
});

test('TYPES | upperCase (default)', (t) => {
const sgc = getConfig(path.join(fixtures, '.sgcrc'));

const choicesList = choices(sgc);

t.is(choicesList[0].value, 'Add:');
});

test('TYPES | lowerCase', (t) => {
const sgc = getConfig(path.join(fixtures, '.sgcrc'));

sgc.lowercaseTypes = true;

const choicesList = choices(sgc);

t.is(choicesList[0].value, 'add:');
});

test('SCOPE | check if scope is off by default', (t) => {
const config = getConfig();
const questionsList = questions(config);
Expand Down