File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ module.exports = {
7
7
coveragePathIgnorePatterns : [ ".test-d.ts" ] ,
8
8
coverageThreshold : {
9
9
global : {
10
- statements : 99 ,
11
- branches : 87 ,
10
+ statements : 100 ,
11
+ branches : 89 ,
12
12
functions : 100 ,
13
- lines : 99 ,
13
+ lines : 100 ,
14
14
} ,
15
15
} ,
16
16
} ;
Original file line number Diff line number Diff line change @@ -92,6 +92,24 @@ describe("processors", () => {
92
92
diffProcessors . postprocess ( messagesWithFatal , filename )
93
93
) . toHaveLength ( 3 ) ;
94
94
} ) ;
95
+
96
+ it ( "should report fatal errors for staged postprocess with unclean index" , async ( ) => {
97
+ gitMocked . hasCleanIndex . mockReturnValueOnce ( false ) ;
98
+ gitMocked . getDiffForFile . mockReturnValueOnce ( fixtureStaged ) ;
99
+
100
+ const { staged : stagedProcessors } = await import ( "./processors" ) ;
101
+
102
+ const fileWithDirtyIndex = "file-with-dirty-index.js" ;
103
+ const [ errorMessage ] = stagedProcessors . postprocess (
104
+ messages ,
105
+ fileWithDirtyIndex
106
+ ) ;
107
+
108
+ expect ( errorMessage ?. fatal ) . toBe ( true ) ;
109
+ expect ( errorMessage ?. message ) . toMatchInlineSnapshot (
110
+ `"file-with-dirty-index.js has unstaged changes. Please stage or remove the changes."`
111
+ ) ;
112
+ } ) ;
95
113
} ) ;
96
114
97
115
describe ( "configs" , ( ) => {
You can’t perform that action at this time.
0 commit comments