diff --git a/.sgcrc b/.sgcrc index 0e56346..a377158 100644 --- a/.sgcrc +++ b/.sgcrc @@ -2,6 +2,7 @@ "scope": false, "body": true, "emoji": false, + "lowercaseTypes": false, "initial-commit": { "isEnabled": true, "emoji": ":tada:", diff --git a/lib/questions.js b/lib/questions.js index 3406be0..d356471 100644 --- a/lib/questions.js +++ b/lib/questions.js @@ -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({ diff --git a/test/fixtures/.sgcrc b/test/fixtures/.sgcrc index ad62d82..3b6de2a 100644 --- a/test/fixtures/.sgcrc +++ b/test/fixtures/.sgcrc @@ -2,6 +2,7 @@ "scope": false, "body": true, "emoji": false, + "lowercaseTypes": false, "initial-commit": { "isEnabled": true, "emoji": ":tada:", diff --git a/test/questions.js b/test/questions.js index 8a89020..12c49cb 100644 --- a/test/questions.js +++ b/test/questions.js @@ -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);