@@ -10,6 +10,8 @@ import waitsFor from '@artemv/wait-until-promise';
10
10
11
11
const sleep = n => new Promise ( r => setTimeout ( r , n ) ) ;
12
12
13
+ jasmine . DEFAULT_TIMEOUT_INTERVAL = SAVE_TIMEOUT + 100
14
+
13
15
describe ( 'CodeFormatManager' , ( ) => {
14
16
let textEditor ;
15
17
let manager ;
@@ -46,7 +48,7 @@ describe('CodeFormatManager', () => {
46
48
atom . views . getView ( textEditor ) ,
47
49
'code-format:format-code' ,
48
50
) ;
49
- await waitsFor ( ( ) => textEditor . getText ( ) === 'def' ) ;
51
+ await waitsFor ( ( ) => textEditor . getText ( ) === 'def' , SAVE_TIMEOUT ) ;
50
52
} ) ;
51
53
52
54
it ( 'format an editor using formatEntireFile' , async ( ) => {
@@ -61,7 +63,7 @@ describe('CodeFormatManager', () => {
61
63
atom . views . getView ( textEditor ) ,
62
64
'code-format:format-code' ,
63
65
) ;
64
- await waitsFor ( ( ) => textEditor . getText ( ) === 'ghi' ) ;
66
+ await waitsFor ( ( ) => textEditor . getText ( ) === 'ghi' , SAVE_TIMEOUT ) ;
65
67
} ) ;
66
68
67
69
it ( 'formats an editor on type' , async ( ) => {
@@ -87,7 +89,7 @@ describe('CodeFormatManager', () => {
87
89
textEditor . insertText ( 'b' ) ;
88
90
textEditor . insertText ( 'c' ) ;
89
91
90
- await waitsFor ( ( ) => textEditor . getText ( ) === 'def' ) ;
92
+ await waitsFor ( ( ) => textEditor . getText ( ) === 'def' , SAVE_TIMEOUT ) ;
91
93
// Debouncing should ensure only one format call.
92
94
expect ( spy . mock . calls . length ) . toBe ( 1 ) ;
93
95
} ) ;
@@ -128,7 +130,7 @@ describe('CodeFormatManager', () => {
128
130
129
131
// Wait until the buffer has been saved and verify it has been saved exactly
130
132
// once.
131
- await waitsFor ( ( ) => spy . mock . calls . length > 0 ) ;
133
+ await waitsFor ( ( ) => spy . mock . calls . length > 0 , SAVE_TIMEOUT ) ;
132
134
expect ( spy . mock . calls . length ) . toBe ( 1 ) ;
133
135
} ) ;
134
136
} ) ;
0 commit comments