Skip to content

Commit

Permalink
🐛 Fix: change emojies default to true
Browse files Browse the repository at this point in the history
  • Loading branch information
JPeer264 committed Apr 18, 2017
1 parent 5b8c15d commit ecb1d74
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion .sgcrc_default
@@ -1,5 +1,4 @@
{
"emojies": true,
"types": [
{
"emoji": ":wrench:",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -56,7 +56,7 @@ A boolean to enable emojies at the beginning of a commit message
Example:
```json
{
"emojies": false
"emojies": true
}
```

Expand Down
3 changes: 2 additions & 1 deletion lib/promptConfig.js
Expand Up @@ -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 || '';

Expand Down
8 changes: 4 additions & 4 deletions test/promptConfig.js
Expand Up @@ -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);
Expand Down

0 comments on commit ecb1d74

Please sign in to comment.