@@ -10,47 +10,47 @@ describe('The jsonlint provider for Linter', () => {
10
10
11
11
beforeEach ( ( ) => {
12
12
atom . workspace . destroyActivePaneItem ( ) ;
13
- waitsForPromise ( ( ) =>
14
- Promise . all ( [
15
- atom . packages . activatePackage ( 'linter-jsonlint' ) ,
16
- atom . packages . activatePackage ( 'language-json' )
17
- ] ) ) ;
13
+ waitsForPromise ( ( ) => Promise . all ( [
14
+ atom . packages . activatePackage ( 'linter-jsonlint' ) ,
15
+ atom . packages . activatePackage ( 'language-json' )
16
+ ] ) ) ;
18
17
} ) ;
19
18
20
19
describe ( 'checks bad.md and' , ( ) => {
21
20
let editor = null ;
22
21
beforeEach ( ( ) => {
23
- waitsForPromise ( ( ) =>
24
- atom . workspace . open ( badPath ) . then ( ( openEditor ) => {
25
- editor = openEditor ;
26
- } ) ) ;
22
+ waitsForPromise ( ( ) => atom . workspace . open ( badPath ) . then ( ( openEditor ) => {
23
+ editor = openEditor ;
24
+ } ) ) ;
27
25
} ) ;
28
26
29
27
it ( 'finds at least one message' , ( ) => {
30
- waitsForPromise ( ( ) =>
31
- lint ( editor ) . then ( messages => expect ( messages . length ) . toBeGreaterThan ( 0 ) ) ) ;
28
+ waitsForPromise ( ( ) => lint ( editor ) . then ( ( messages ) => {
29
+ expect ( messages . length ) . toBeGreaterThan ( 0 ) ;
30
+ } ) ) ;
32
31
} ) ;
33
32
34
33
it ( 'verifies the first message' , ( ) => {
35
- waitsForPromise ( ( ) =>
36
- lint ( editor ) . then ( ( messages ) => {
37
- expect ( messages [ 0 ] . severity ) . toEqual ( 'error' ) ;
38
- expect ( messages [ 0 ] . excerpt ) . toEqual ( `Parse error on line 2:
34
+ waitsForPromise ( ( ) => lint ( editor ) . then ( ( messages ) => {
35
+ expect ( messages [ 0 ] . severity ) . toEqual ( 'error' ) ;
36
+ expect ( messages [ 0 ] . excerpt ) . toEqual ( `Parse error on line 2:
39
37
{ "key": 1 + 2}
40
38
------------^
41
39
Expecting 'EOF', '}', ',', ']', got 'undefined'` ) ;
42
- expect ( messages [ 0 ] . location . file ) . toMatch ( / .+ b a d \. j s o n $ / ) ;
43
- expect ( messages [ 0 ] . location . position ) . toEqual ( {
44
- start : { row : 2 , column : 0 } ,
45
- end : { row : 2 , column : 1 }
46
- } ) ;
47
- } ) ) ;
40
+ expect ( messages [ 0 ] . location . file ) . toMatch ( / .+ b a d \. j s o n $ / ) ;
41
+ expect ( messages [ 0 ] . location . position ) . toEqual ( {
42
+ start : { row : 2 , column : 0 } ,
43
+ end : { row : 2 , column : 1 }
44
+ } ) ;
45
+ } ) ) ;
48
46
} ) ;
49
47
} ) ;
50
48
51
49
it ( 'finds nothing wrong with a valid file' , ( ) => {
52
- waitsForPromise ( ( ) =>
53
- atom . workspace . open ( goodPath ) . then ( editor =>
54
- lint ( editor ) . then ( messages => expect ( messages . length ) . toEqual ( 0 ) ) ) ) ;
50
+ waitsForPromise ( ( ) => atom . workspace . open ( goodPath ) . then ( ( editor ) => {
51
+ lint ( editor ) . then ( ( messages ) => {
52
+ expect ( messages . length ) . toEqual ( 0 ) ;
53
+ } ) ;
54
+ } ) ) ;
55
55
} ) ;
56
56
} ) ;
0 commit comments