Skip to content

Commit 4e5408d

Browse files
committed
✅ Test: correct test choices generated from .sgcrc_default
1 parent 4352f3a commit 4e5408d

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

test/prompConfig.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,20 @@ test('choises are the same as choises generated from .sgcrc_default', (t) => {
2121
const choices = cli.choices(config);
2222
const choicesList = [];
2323

24-
sgc.types.forEach((type) => {
25-
const emoji = `${type.emoji} ` || '';
26-
const configType = type.type;
27-
const description = type.description || '';
24+
Promise.resolve(() => {
25+
sgc.types.forEach((type) => {
26+
const emoji = `${type.emoji} ` || '';
27+
const configType = type.type;
28+
const description = type.description || '';
2829

29-
choicesList.push({
30-
value: emoji + configType,
31-
name: `${chalk.bold(configType)} ${description}`,
30+
choicesList.push({
31+
value: emoji + configType,
32+
name: `${chalk.bold(configType)} ${description}`,
33+
});
34+
}).then(() => {
35+
t.deepEqual(choices, choicesList);
3236
});
3337
});
34-
t.deepEqual(choices, choicesList);
3538
});
3639

3740
test('check the values of the question object', (t) => {
@@ -76,7 +79,7 @@ test('check cli', (t) => {
7679
];
7780
const cli = promptConfig;
7881
return Promise.resolve(cli.prompt(questions))
79-
.then((res) => {
80-
t.deepEqual('2', res);
81-
});
82+
.then((res) => {
83+
t.deepEqual('2', res);
84+
});
8285
});

0 commit comments

Comments
 (0)