@@ -136,85 +136,70 @@ test('should produce no error output with -q flag', async t => {
136
136
} ) ;
137
137
138
138
test ( 'should work with husky commitmsg hook and git commit' , async t => {
139
- await t . notThrowsAsync ( async ( ) => {
140
- const cwd = await git . bootstrap ( 'fixtures/husky/integration' ) ;
141
- await writePkg ( { husky : { hooks : { 'commit-msg' : `'${ bin } ' -e` } } } , { cwd} ) ;
139
+ const cwd = await git . bootstrap ( 'fixtures/husky/integration' ) ;
140
+ await writePkg ( { husky : { hooks : { 'commit-msg' : `'${ bin } ' -e` } } } , { cwd} ) ;
142
141
143
- await execa ( 'npm' , [ 'install' ] , { cwd} ) ;
144
- await execa ( 'git' , [ 'add' , 'package.json' ] , { cwd} ) ;
145
- await execa ( 'git' , [ 'commit' , '-m' , '"test: this should work"' ] , { cwd} ) ;
146
- } ) ;
142
+ await execa ( 'npm' , [ 'install' ] , { cwd} ) ;
143
+ await execa ( 'git' , [ 'add' , 'package.json' ] , { cwd} ) ;
144
+ await execa ( 'git' , [ 'commit' , '-m' , '"test: this should work"' ] , { cwd} ) ;
147
145
} ) ;
148
146
149
147
test ( 'should work with husky commitmsg hook in sub packages' , async t => {
150
- await t . notThrowsAsync ( async ( ) => {
151
- const upper = await git . bootstrap ( 'fixtures/husky' ) ;
152
- const cwd = path . join ( upper , 'integration' ) ;
153
- await writePkg (
154
- { husky : { hooks : { 'commit-msg' : `'${ bin } ' -e` } } } ,
155
- { cwd : upper }
156
- ) ;
148
+ const upper = await git . bootstrap ( 'fixtures/husky' ) ;
149
+ const cwd = path . join ( upper , 'integration' ) ;
150
+ await writePkg ( { husky : { hooks : { 'commit-msg' : `'${ bin } ' -e` } } } , { cwd : upper } ) ;
157
151
158
- await execa ( 'npm' , [ 'install' ] , { cwd} ) ;
159
- await execa ( 'git' , [ 'add' , 'package.json' ] , { cwd} ) ;
160
- await execa ( 'git' , [ 'commit' , '-m' , '"test: this should work"' ] , { cwd} ) ;
161
- } ) ;
152
+ await execa ( 'npm' , [ 'install' ] , { cwd} ) ;
153
+ await execa ( 'git' , [ 'add' , 'package.json' ] , { cwd} ) ;
154
+ await execa ( 'git' , [ 'commit' , '-m' , '"test: this should work"' ] , { cwd} ) ;
162
155
} ) ;
163
156
164
157
test ( 'should work with husky via commitlint -e $GIT_PARAMS' , async t => {
165
- await t . notThrowsAsync ( async ( ) => {
166
- const cwd = await git . bootstrap ( 'fixtures/husky/integration' ) ;
167
- await writePkg (
168
- { husky : { hooks : { 'commit-msg' : `'${ bin } ' -e $GIT_PARAMS` } } } ,
169
- { cwd}
170
- ) ;
158
+ const cwd = await git . bootstrap ( 'fixtures/husky/integration' ) ;
159
+ await writePkg (
160
+ { husky : { hooks : { 'commit-msg' : `'${ bin } ' -e $GIT_PARAMS` } } } ,
161
+ { cwd}
162
+ ) ;
171
163
172
- await execa ( 'npm' , [ 'install' ] , { cwd} ) ;
173
- await execa ( 'git' , [ 'add' , 'package.json' ] , { cwd} ) ;
174
- await execa ( 'git' , [ 'commit' , '-m' , '"test: this should work"' ] , { cwd} ) ;
175
- } ) ;
164
+ await execa ( 'npm' , [ 'install' ] , { cwd} ) ;
165
+ await execa ( 'git' , [ 'add' , 'package.json' ] , { cwd} ) ;
166
+ await execa ( 'git' , [ 'commit' , '-m' , '"test: this should work"' ] , { cwd} ) ;
176
167
} ) ;
177
168
178
169
test ( 'should work with husky via commitlint -e %GIT_PARAMS%' , async t => {
179
- await t . notThrowsAsync ( async ( ) => {
180
- const cwd = await git . bootstrap ( 'fixtures/husky/integration' ) ;
181
- await writePkg (
182
- { husky : { hooks : { 'commit-msg' : `'${ bin } ' -e %GIT_PARAMS%` } } } ,
183
- { cwd}
184
- ) ;
170
+ const cwd = await git . bootstrap ( 'fixtures/husky/integration' ) ;
171
+ await writePkg (
172
+ { husky : { hooks : { 'commit-msg' : `'${ bin } ' -e %GIT_PARAMS%` } } } ,
173
+ { cwd}
174
+ ) ;
185
175
186
- await execa ( 'npm' , [ 'install' ] , { cwd} ) ;
187
- await execa ( 'git' , [ 'add' , 'package.json' ] , { cwd} ) ;
188
- await execa ( 'git' , [ 'commit' , '-m' , '"test: this should work"' ] , { cwd} ) ;
189
- } ) ;
176
+ await execa ( 'npm' , [ 'install' ] , { cwd} ) ;
177
+ await execa ( 'git' , [ 'add' , 'package.json' ] , { cwd} ) ;
178
+ await execa ( 'git' , [ 'commit' , '-m' , '"test: this should work"' ] , { cwd} ) ;
190
179
} ) ;
191
180
192
181
test ( 'should work with husky via commitlint -e $HUSKY_GIT_PARAMS' , async t => {
193
- await t . notThrowsAsync ( async ( ) => {
194
- const cwd = await git . bootstrap ( 'fixtures/husky/integration' ) ;
195
- await writePkg (
196
- { husky : { hooks : { 'commit-msg' : `'${ bin } ' -e $HUSKY_GIT_PARAMS` } } } ,
197
- { cwd}
198
- ) ;
182
+ const cwd = await git . bootstrap ( 'fixtures/husky/integration' ) ;
183
+ await writePkg (
184
+ { husky : { hooks : { 'commit-msg' : `'${ bin } ' -e $HUSKY_GIT_PARAMS` } } } ,
185
+ { cwd}
186
+ ) ;
199
187
200
- await execa ( 'npm' , [ 'install' ] , { cwd} ) ;
201
- await execa ( 'git' , [ 'add' , 'package.json' ] , { cwd} ) ;
202
- await execa ( 'git' , [ 'commit' , '-m' , '"test: this should work"' ] , { cwd} ) ;
203
- } ) ;
188
+ await execa ( 'npm' , [ 'install' ] , { cwd} ) ;
189
+ await execa ( 'git' , [ 'add' , 'package.json' ] , { cwd} ) ;
190
+ await execa ( 'git' , [ 'commit' , '-m' , '"test: this should work"' ] , { cwd} ) ;
204
191
} ) ;
205
192
206
193
test ( 'should work with husky via commitlint -e %HUSKY_GIT_PARAMS%' , async t => {
207
- await t . notThrowsAsync ( async ( ) => {
208
- const cwd = await git . bootstrap ( 'fixtures/husky/integration' ) ;
209
- await writePkg (
210
- { husky : { hooks : { 'commit-msg' : `'${ bin } ' -e %HUSKY_GIT_PARAMS%` } } } ,
211
- { cwd}
212
- ) ;
194
+ const cwd = await git . bootstrap ( 'fixtures/husky/integration' ) ;
195
+ await writePkg (
196
+ { husky : { hooks : { 'commit-msg' : `'${ bin } ' -e %HUSKY_GIT_PARAMS%` } } } ,
197
+ { cwd}
198
+ ) ;
213
199
214
- await execa ( 'npm' , [ 'install' ] , { cwd} ) ;
215
- await execa ( 'git' , [ 'add' , 'package.json' ] , { cwd} ) ;
216
- await execa ( 'git' , [ 'commit' , '-m' , '"test: this should work"' ] , { cwd} ) ;
217
- } ) ;
200
+ await execa ( 'npm' , [ 'install' ] , { cwd} ) ;
201
+ await execa ( 'git' , [ 'add' , 'package.json' ] , { cwd} ) ;
202
+ await execa ( 'git' , [ 'commit' , '-m' , '"test: this should work"' ] , { cwd} ) ;
218
203
} ) ;
219
204
220
205
test ( 'should allow reading of environment variables for edit file, succeeding if valid' , async t => {
@@ -291,19 +276,17 @@ test('should pick up config from inside git repo with precedence and fail accord
291
276
} ) ;
292
277
293
278
test ( 'should handle --amend with signoff' , async t => {
294
- await t . notThrowsAsync ( async ( ) => {
295
- const cwd = await git . bootstrap ( 'fixtures/signoff' ) ;
296
- await writePkg ( { husky : { hooks : { 'commit-msg' : `'${ bin } ' -e` } } } , { cwd} ) ;
297
-
298
- await execa ( 'npm' , [ 'install' ] , { cwd} ) ;
299
- await execa ( 'git' , [ 'add' , 'package.json' ] , { cwd} ) ;
300
- await execa (
301
- 'git' ,
302
- [ 'commit' , '-m' , '"test: this should work"' , '--signoff' ] ,
303
- { cwd}
304
- ) ;
305
- await execa ( 'git' , [ 'commit' , '--amend' , '--no-edit' ] , { cwd} ) ;
306
- } ) ;
279
+ const cwd = await git . bootstrap ( 'fixtures/signoff' ) ;
280
+ await writePkg ( { husky : { hooks : { 'commit-msg' : `'${ bin } ' -e` } } } , { cwd} ) ;
281
+
282
+ await execa ( 'npm' , [ 'install' ] , { cwd} ) ;
283
+ await execa ( 'git' , [ 'add' , 'package.json' ] , { cwd} ) ;
284
+ await execa (
285
+ 'git' ,
286
+ [ 'commit' , '-m' , '"test: this should work"' , '--signoff' ] ,
287
+ { cwd}
288
+ ) ;
289
+ await execa ( 'git' , [ 'commit' , '--amend' , '--no-edit' ] , { cwd} ) ;
307
290
} ) ;
308
291
309
292
test ( 'should handle linting with issue prefixes' , async t => {
0 commit comments