Skip to content

Commit 1ca3d30

Browse files
committed
Feat: change emoji default to false
BREAKING CHANGE: changed the default to false
1 parent d59514a commit 1ca3d30

File tree

6 files changed

+14
-7
lines changed

6 files changed

+14
-7
lines changed

.sgcrc_default

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
2+
"questions": {
3+
"scope": false,
4+
"moreInfo": true
5+
},
6+
"emojies": false,
27
"types": [
38
{
49
"emoji": ":wrench:",

lib/questions.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ const choices = (config) => {
66
const choicesList = [];
77

88
config.types.forEach((type) => {
9-
const isEmojies = config.emojies === undefined ? true : config.emojies;
10-
const emoji = isEmojies && type.emoji ? `${type.emoji} ` : '';
9+
const emoji = config.emojies && type.emoji ? `${type.emoji} ` : '';
1110
const configType = type.type;
1211
const description = type.description || '';
1312

test/cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test('should print the right version', async (t) => {
1414
});
1515

1616
// make serial due to dynamic process.chdir switching
17-
test.serial('should fail on non git repository', async (t) => {
17+
test('should fail on non git repository', async (t) => {
1818
// assume that the homedir is not a git repo
1919
process.chdir(homedir());
2020

test/fixtures/.sgcrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"scope": false,
44
"moreInfo": true
55
},
6+
"emojies": false,
67
"types": [
78
{
89
"emoji": ":emo:",

test/getConfig.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@ test('read config from package.json', (t) => {
5454
fs.renameSync(path.join(cwd, 'package.json'), path.join(cwd, `package.json.${randomString}-${datetime}.back`));
5555
fs.writeFileSync(path.join(cwd, 'package.json'), JSON.stringify(packageJson));
5656

57-
t.deepEqual(getConfig(), sgcrc);
57+
const config = getConfig();
5858

5959
// revert local package
6060
fs.removeSync(path.join(cwd, 'package.json'));
6161
fs.renameSync(path.join(cwd, `package.json.${randomString}-${datetime}.back`), path.join(cwd, 'package.json'));
62+
63+
t.deepEqual(config, sgcrc);
6264
});
6365

6466
test('read global config', (t) => {

test/questions.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ test.after.always(() => {
3232

3333
test('choices are rendered without emojis', (t) => {
3434
const sgc = getConfig(path.join(fixtures, '.sgcrc'));
35-
36-
sgc.emojies = false;
37-
3835
const choicesList = choices(sgc);
3936

4037
t.deepEqual(choicesList, withoutEmoji);
4138
});
4239

4340
test('choices are rendered with emojis (default)', (t) => {
4441
const sgc = getConfig(path.join(fixtures, '.sgcrc'));
42+
43+
sgc.emojies = true;
44+
4545
const choicesList = choices(sgc);
4646

4747
t.deepEqual(choicesList, withEmoji);

0 commit comments

Comments
 (0)