File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -76,17 +76,17 @@ export default function linter(options, compilation) {
76
76
77
77
await cleanup ( ) ;
78
78
79
- // do not analyze if there are no results or eslint config
80
- if ( ! results || results . length < 1 ) {
81
- return { } ;
82
- }
83
-
84
79
for ( const result of results ) {
85
80
crossRunResultStorage [ result . filePath ] = result ;
86
81
}
87
82
88
83
results = Object . values ( crossRunResultStorage ) ;
89
84
85
+ // do not analyze if there are no results or eslint config
86
+ if ( ! results || results . length < 1 ) {
87
+ return { } ;
88
+ }
89
+
90
90
const formatter = await loadFormatter ( eslint , options . formatter ) ;
91
91
const { errors, warnings } = formatResults (
92
92
formatter ,
Original file line number Diff line number Diff line change @@ -103,7 +103,11 @@ describe('watch', () => {
103
103
function finish ( err , stats ) {
104
104
expect ( err ) . toBeNull ( ) ;
105
105
expect ( stats . hasWarnings ( ) ) . toBe ( false ) ;
106
- expect ( stats . hasErrors ( ) ) . toBe ( false ) ;
106
+ const { errors } = stats . compilation ;
107
+ const [ { message } ] = errors ;
108
+ expect ( stats . hasErrors ( ) ) . toBe ( true ) ;
109
+ expect ( message ) . toEqual ( expect . stringMatching ( 'prefer-const' ) ) ;
110
+ expect ( message ) . toEqual ( expect . stringMatching ( '\\(2 errors,' ) ) ;
107
111
done ( ) ;
108
112
}
109
113
} ) ;
You can’t perform that action at this time.
0 commit comments