@@ -8,42 +8,34 @@ describe('The htmlhint provider for Linter', () => {
8
8
beforeEach ( ( ) => {
9
9
atom . workspace . destroyActivePaneItem ( ) ;
10
10
waitsForPromise ( ( ) =>
11
- atom
12
- . packages
13
- . activatePackage ( 'linter-htmlhint ' )
14
- . then ( ( ) => atom . packages . activatePackage ( 'language-html' ) )
11
+ Promise . all ( [
12
+ atom . packages . activatePackage ( 'linter-htmlhint' ) ,
13
+ atom . packages . activatePackage ( 'language-html ' )
14
+ ] )
15
15
) ;
16
16
} ) ;
17
17
18
18
it ( 'detects invalid coding style in bad.html and report as error' , ( ) => {
19
19
waitsForPromise ( ( ) => {
20
20
const bad = path . join ( __dirname , 'fixtures' , 'bad.html' ) ;
21
- return atom
22
- . workspace
23
- . open ( bad )
24
- . then ( editor => lint ( editor ) )
25
- . then ( messages => {
26
- expect ( messages . length ) . toEqual ( 1 ) ;
21
+ return atom . workspace . open ( bad ) . then ( editor => lint ( editor ) ) . then ( messages => {
22
+ expect ( messages . length ) . toEqual ( 1 ) ;
27
23
28
- // test only the first error
29
- expect ( messages [ 0 ] . type ) . toEqual ( 'error' ) ;
30
- expect ( messages [ 0 ] . text ) . toEqual ( 'Doctype must be declared first.' ) ;
31
- expect ( messages [ 0 ] . filePath ) . toMatch ( / .+ b a d \. h t m l $ / ) ;
32
- expect ( messages [ 0 ] . range ) . toEqual ( [ [ 0 , 0 ] , [ 0 , 13 ] ] ) ;
33
- } ) ;
24
+ // test only the first error
25
+ expect ( messages [ 0 ] . type ) . toEqual ( 'error' ) ;
26
+ expect ( messages [ 0 ] . text ) . toEqual ( 'Doctype must be declared first.' ) ;
27
+ expect ( messages [ 0 ] . filePath ) . toMatch ( / .+ b a d \. h t m l $ / ) ;
28
+ expect ( messages [ 0 ] . range ) . toEqual ( [ [ 0 , 0 ] , [ 0 , 13 ] ] ) ;
29
+ } ) ;
34
30
} ) ;
35
31
} ) ;
36
32
37
33
it ( 'finds nothing wrong with a valid file (good.html)' , ( ) => {
38
34
waitsForPromise ( ( ) => {
39
35
const good = path . join ( __dirname , 'fixtures' , 'good.html' ) ;
40
- return atom
41
- . workspace
42
- . open ( good )
43
- . then ( editor => lint ( editor ) )
44
- . then ( messages => {
45
- expect ( messages . length ) . toEqual ( 0 ) ;
46
- } ) ;
36
+ return atom . workspace . open ( good ) . then ( editor => lint ( editor ) ) . then ( messages => {
37
+ expect ( messages . length ) . toEqual ( 0 ) ;
38
+ } ) ;
47
39
} ) ;
48
40
} ) ;
49
41
} ) ;
0 commit comments