diff --git a/.sgcrc_default b/.sgcrc_default index 0ef7f58..8ee1a17 100644 --- a/.sgcrc_default +++ b/.sgcrc_default @@ -1,5 +1,4 @@ { - "emojies": true, "types": [ { "emoji": ":wrench:", diff --git a/README.md b/README.md index 1752bb0..5041c98 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ A boolean to enable emojies at the beginning of a commit message Example: ```json { - "emojies": false + "emojies": true } ``` diff --git a/lib/promptConfig.js b/lib/promptConfig.js index 361fc78..3d70653 100644 --- a/lib/promptConfig.js +++ b/lib/promptConfig.js @@ -5,7 +5,8 @@ const choices = (configuration) => { const choicesList = []; configuration.types.forEach((type) => { - const emoji = configuration.emojies && type.emoji ? `${type.emoji} ` : ''; + const isEmojies = configuration.emojies === undefined ? true : configuration.emojies; + const emoji = isEmojies && type.emoji ? `${type.emoji} ` : ''; const configType = type.type; const description = type.description || ''; diff --git a/test/promptConfig.js b/test/promptConfig.js index aaba03d..7a0f588 100644 --- a/test/promptConfig.js +++ b/test/promptConfig.js @@ -37,16 +37,16 @@ test('get configuration file equals .sgcrc_default', (t) => { test('choices are rendered without emojis', (t) => { const sgc = getConfig(path.join(fixtures, '.sgcrc')); + + sgc.emojies = false; + const choicesList = choices(sgc); t.deepEqual(choicesList, withoutEmoji); }); -test('choices are rendered with emojis', (t) => { +test('choices are rendered with emojis (default)', (t) => { const sgc = getConfig(path.join(fixtures, '.sgcrc')); - - sgc.emojies = true; - const choicesList = choices(sgc); t.deepEqual(choicesList, withEmoji);