File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,11 @@ test('throws without params', async () => {
6
6
} ) ;
7
7
8
8
test ( 'throws with empty message' , async ( ) => {
9
- const error = ( lint as any ) ( '' ) ;
10
- await expect ( error ) . rejects . toThrow ( 'Expected a raw commit' ) ;
9
+ expect ( await lint ( '' ) ) . toMatchObject ( {
10
+ valid : true ,
11
+ errors : [ ] ,
12
+ warnings : [ ]
13
+ } ) ;
11
14
} ) ;
12
15
13
16
test ( 'positive on stub message and no rule' , async ( ) => {
Original file line number Diff line number Diff line change @@ -28,8 +28,10 @@ export default async function lint(
28
28
return LintOutcome . empty ( { message} ) ;
29
29
}
30
30
31
- // Parse the commit message
32
- const parsed = await parse ( message , undefined , opts . parserOpts ) ;
31
+ const parsed =
32
+ message === ''
33
+ ? { header : null , body : null , footer : null }
34
+ : await parse ( message , undefined , opts . parserOpts ) ;
33
35
34
36
if (
35
37
parsed . header === null &&
You can’t perform that action at this time.
0 commit comments