@@ -9,41 +9,35 @@ describe('createLinterEngine', () => {
9
9
const rule1 = mock . fn ( ( ) => [ ] ) ;
10
10
const rule2 = mock . fn ( ( ) => [ ] ) ;
11
11
12
- const engine = createLinterEngine ( {
13
- singleEntryRules : [ rule1 ] ,
14
- multiEntryRules : [ rule2 ] ,
15
- } ) ;
12
+ const engine = createLinterEngine ( [ rule1 , rule2 ] ) ;
16
13
17
14
engine . lintAll ( [ assertEntry ] ) ;
18
15
19
16
assert . strictEqual ( rule1 . mock . callCount ( ) , 1 ) ;
20
17
assert . strictEqual ( rule2 . mock . callCount ( ) , 1 ) ;
21
18
22
- assert . deepEqual ( rule1 . mock . calls [ 0 ] . arguments , [ assertEntry ] ) ;
19
+ assert . deepEqual ( rule1 . mock . calls [ 0 ] . arguments , [ [ assertEntry ] ] ) ;
23
20
assert . deepEqual ( rule2 . mock . calls [ 0 ] . arguments , [ [ assertEntry ] ] ) ;
24
21
} ) ;
25
22
26
23
it ( 'should return the aggregated issues from all rules' , ( ) => {
27
24
const rule1 = mock . fn ( ( ) => [ infoIssue , warnIssue ] ) ;
28
25
const rule2 = mock . fn ( ( ) => [ errorIssue ] ) ;
29
26
30
- const engine = createLinterEngine ( {
31
- singleEntryRules : [ rule1 ] ,
32
- multiEntryRules : [ rule2 ] ,
33
- } ) ;
27
+ const engine = createLinterEngine ( [ rule1 , rule2 ] ) ;
34
28
35
29
const issues = engine . lintAll ( [ assertEntry ] ) ;
36
30
37
31
assert . equal ( issues . length , 3 ) ;
38
- assert . deepEqual ( issues , [ errorIssue , infoIssue , warnIssue ] ) ;
32
+ assert . deepEqual ( issues , [ infoIssue , warnIssue , errorIssue ] ) ;
39
33
} ) ;
40
34
41
35
it ( 'should return an empty array when no issues are found' , ( ) => {
42
36
const rule = ( ) => [ ] ;
43
37
44
- const engine = createLinterEngine ( { singleEntryRules : [ rule ] } ) ;
38
+ const engine = createLinterEngine ( [ rule ] ) ;
45
39
46
- const issues = engine . lint ( assertEntry ) ;
40
+ const issues = engine . lintAll ( [ assertEntry ] ) ;
47
41
48
42
assert . deepEqual ( issues , [ ] ) ;
49
43
} ) ;
0 commit comments