File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -113,10 +113,20 @@ describe('ESLintParser', () => {
113
113
const result = new ESLintParser ( cwd ) . parse ( mockedContentString ) ;
114
114
const valid = result . filter ( ( el ) => el . valid ) ;
115
115
const invalid = result . filter ( ( el ) => ! el . valid ) ;
116
- expect ( valid ) . toHaveLength ( 1 ) ;
116
+ expect ( valid ) . toHaveLength ( 2 ) ;
117
117
expect ( invalid ) . toHaveLength ( 1 ) ;
118
118
} ) ;
119
119
120
+ it ( 'Should parse with severity correctly' , ( ) => {
121
+ const result = new ESLintParser ( cwd ) . parse ( mockedContentString ) ;
122
+ const resultWithError = result . filter ( ( el ) => el . severity === LintSeverity . error ) ;
123
+ const resultWithWarning = result . filter ( ( el ) => el . severity === LintSeverity . warning ) ;
124
+ const ignoredResult = result . filter ( ( el ) => el . severity === LintSeverity . ignore ) ;
125
+ expect ( resultWithError ) . toHaveLength ( 1 ) ;
126
+ expect ( resultWithWarning ) . toHaveLength ( 1 ) ;
127
+ expect ( ignoredResult ) . toHaveLength ( 1 ) ;
128
+ } ) ;
129
+
120
130
it ( 'Should throw error if the line not match the rule' , ( ) => {
121
131
expect ( ( ) => new ESLintParser ( cwd ) . parse ( ':' ) ) . toThrow ( ) ;
122
132
} ) ;
Original file line number Diff line number Diff line change 1
- import { ProjectType } from '../Config' ;
1
+ import { ProjectType } from '../Config/@enums ' ;
2
2
import { Log } from '../Logger' ;
3
3
import { getRelativePath } from './utils/path.util' ;
4
4
import { LintSeverity } from './@enums/LintSeverity' ;
You can’t perform that action at this time.
0 commit comments