@@ -5,6 +5,22 @@ import { defineConfig } from '#index';
5
5
import type { UserConfig } from '@commitlint/types' ;
6
6
7
7
describe ( 'Commitlint Config' , async ( ) => {
8
+ const generateEnum = async ( ) => ( {
9
+ customProperty : {
10
+ description : '' ,
11
+ title : '' ,
12
+ emoji : '' ,
13
+ } ,
14
+ } ) ;
15
+
16
+ const promptQuestions = async ( ) => ( {
17
+ description : '' ,
18
+ messages : {
19
+ customMessage : '' ,
20
+ } ,
21
+ enum : await generateEnum ( ) ,
22
+ } ) ;
23
+
8
24
spec ( 'should return empty config' , async ( ) => {
9
25
expectTypeOf ( defineConfig ( { } ) ) . toEqualTypeOf < UserConfig > ( ) ;
10
26
} ) ;
@@ -42,162 +58,18 @@ describe('Commitlint Config', async () => {
42
58
scopeEnumSeparator : '' ,
43
59
} ,
44
60
questions : {
45
- header : {
46
- description : '' ,
47
- messages : {
48
- customMessage : '' ,
49
- } ,
50
- enum : {
51
- customProperty : {
52
- description : '' ,
53
- title : '' ,
54
- emoji : '' ,
55
- } ,
56
- } ,
57
- } ,
58
- type : {
59
- description : '' ,
60
- messages : {
61
- customMessage : '' ,
62
- } ,
63
- enum : {
64
- customProperty : {
65
- description : '' ,
66
- title : '' ,
67
- emoji : '' ,
68
- } ,
69
- } ,
70
- } ,
71
- scope : {
72
- description : '' ,
73
- messages : {
74
- customMessage : '' ,
75
- } ,
76
- enum : {
77
- customProperty : {
78
- description : '' ,
79
- title : '' ,
80
- emoji : '' ,
81
- } ,
82
- } ,
83
- } ,
84
- subject : {
85
- description : '' ,
86
- messages : {
87
- customMessage : '' ,
88
- } ,
89
- enum : {
90
- customProperty : {
91
- description : '' ,
92
- title : '' ,
93
- emoji : '' ,
94
- } ,
95
- } ,
96
- } ,
97
- body : {
98
- description : '' ,
99
- messages : {
100
- customMessage : '' ,
101
- } ,
102
- enum : {
103
- customProperty : {
104
- description : '' ,
105
- title : '' ,
106
- emoji : '' ,
107
- } ,
108
- } ,
109
- } ,
110
- footer : {
111
- description : '' ,
112
- messages : {
113
- customMessage : '' ,
114
- } ,
115
- enum : {
116
- customProperty : {
117
- description : '' ,
118
- title : '' ,
119
- emoji : '' ,
120
- } ,
121
- } ,
122
- } ,
123
- isBreaking : {
124
- description : '' ,
125
- messages : {
126
- customMessage : '' ,
127
- } ,
128
- enum : {
129
- customProperty : {
130
- description : '' ,
131
- title : '' ,
132
- emoji : '' ,
133
- } ,
134
- } ,
135
- } ,
136
- breakingBody : {
137
- description : '' ,
138
- messages : {
139
- customMessage : '' ,
140
- } ,
141
- enum : {
142
- customProperty : {
143
- description : '' ,
144
- title : '' ,
145
- emoji : '' ,
146
- } ,
147
- } ,
148
- } ,
149
- breaking : {
150
- description : '' ,
151
- messages : {
152
- customMessage : '' ,
153
- } ,
154
- enum : {
155
- customProperty : {
156
- description : '' ,
157
- title : '' ,
158
- emoji : '' ,
159
- } ,
160
- } ,
161
- } ,
162
- isIssueAffected : {
163
- description : '' ,
164
- messages : {
165
- customMessage : '' ,
166
- } ,
167
- enum : {
168
- customProperty : {
169
- description : '' ,
170
- title : '' ,
171
- emoji : '' ,
172
- } ,
173
- } ,
174
- } ,
175
- issuesBody : {
176
- description : '' ,
177
- messages : {
178
- customMessage : '' ,
179
- } ,
180
- enum : {
181
- customProperty : {
182
- description : '' ,
183
- title : '' ,
184
- emoji : '' ,
185
- } ,
186
- } ,
187
- } ,
188
- issues : {
189
- description : '' ,
190
- messages : {
191
- customMessage : '' ,
192
- } ,
193
- enum : {
194
- customProperty : {
195
- description : '' ,
196
- title : '' ,
197
- emoji : '' ,
198
- } ,
199
- } ,
200
- } ,
61
+ body : await promptQuestions ( ) ,
62
+ breaking : await promptQuestions ( ) ,
63
+ breakingBody : await promptQuestions ( ) ,
64
+ footer : await promptQuestions ( ) ,
65
+ header : await promptQuestions ( ) ,
66
+ isBreaking : await promptQuestions ( ) ,
67
+ isIssueAffected : await promptQuestions ( ) ,
68
+ issues : await promptQuestions ( ) ,
69
+ issuesBody : await promptQuestions ( ) ,
70
+ scope : await promptQuestions ( ) ,
71
+ subject : await promptQuestions ( ) ,
72
+ type : await promptQuestions ( ) ,
201
73
} ,
202
74
} ,
203
75
rules : { } ,
0 commit comments