@@ -43,9 +43,14 @@ describe('AutoFixModule', () => {
43
43
mockContext . documents . get . mockReturnValue ( document ) ;
44
44
mockContext . __options . validate = [ 'bar' ] ;
45
45
mockContext . getFixes . mockResolvedValue ( [ TextEdit . insert ( Position . create ( 0 , 0 ) , 'text' ) ] ) ;
46
- mockContext . connection . workspace . applyEdit . mockResolvedValue ( { applied : true } ) ;
46
+ mockContext . connection . workspace . applyEdit . mockResolvedValue ( {
47
+ applied : true ,
48
+ } ) ;
47
49
48
- const module = new AutoFixModule ( { context : mockContext . __typed ( ) , logger : mockLogger } ) ;
50
+ const module = new AutoFixModule ( {
51
+ context : mockContext . __typed ( ) ,
52
+ logger : mockLogger ,
53
+ } ) ;
49
54
50
55
module . onDidRegisterHandlers ( ) ;
51
56
@@ -108,7 +113,10 @@ describe('AutoFixModule', () => {
108
113
test ( 'if no matching document exists, should not attempt to auto-fix' , async ( ) => {
109
114
mockContext . documents . get . mockReturnValue ( undefined ) ;
110
115
111
- const module = new AutoFixModule ( { context : mockContext . __typed ( ) , logger : mockLogger } ) ;
116
+ const module = new AutoFixModule ( {
117
+ context : mockContext . __typed ( ) ,
118
+ logger : mockLogger ,
119
+ } ) ;
112
120
113
121
module . onDidRegisterHandlers ( ) ;
114
122
@@ -134,7 +142,10 @@ describe('AutoFixModule', () => {
134
142
mockContext . documents . get . mockReturnValue ( TextDocument . create ( 'foo' , 'bar' , 1 , 'a {}' ) ) ;
135
143
mockContext . __options . validate = [ 'baz' ] ;
136
144
137
- const module = new AutoFixModule ( { context : mockContext . __typed ( ) , logger : mockLogger } ) ;
145
+ const module = new AutoFixModule ( {
146
+ context : mockContext . __typed ( ) ,
147
+ logger : mockLogger ,
148
+ } ) ;
138
149
139
150
module . onDidRegisterHandlers ( ) ;
140
151
@@ -167,7 +178,10 @@ describe('AutoFixModule', () => {
167
178
mockContext . __options . validate = [ 'baz' ] ;
168
179
mockLogger . isDebugEnabled . mockReturnValue ( false ) ;
169
180
170
- const module = new AutoFixModule ( { context : mockContext . __typed ( ) , logger : mockLogger } ) ;
181
+ const module = new AutoFixModule ( {
182
+ context : mockContext . __typed ( ) ,
183
+ logger : mockLogger ,
184
+ } ) ;
171
185
172
186
module . onDidRegisterHandlers ( ) ;
173
187
@@ -195,7 +209,10 @@ describe('AutoFixModule', () => {
195
209
mockContext . documents . get . mockReturnValue ( TextDocument . create ( 'foo' , 'bar' , 2 , 'a {}' ) ) ;
196
210
mockContext . __options . validate = [ 'bar' ] ;
197
211
198
- const module = new AutoFixModule ( { context : mockContext . __typed ( ) , logger : mockLogger } ) ;
212
+ const module = new AutoFixModule ( {
213
+ context : mockContext . __typed ( ) ,
214
+ logger : mockLogger ,
215
+ } ) ;
199
216
200
217
module . onDidRegisterHandlers ( ) ;
201
218
@@ -227,7 +244,10 @@ describe('AutoFixModule', () => {
227
244
mockContext . getFixes . mockResolvedValue ( [ TextEdit . insert ( Position . create ( 0 , 0 ) , 'text' ) ] ) ;
228
245
mockContext . connection . workspace . applyEdit . mockResolvedValue ( response ) ;
229
246
230
- const module = new AutoFixModule ( { context : mockContext . __typed ( ) , logger : mockLogger } ) ;
247
+ const module = new AutoFixModule ( {
248
+ context : mockContext . __typed ( ) ,
249
+ logger : mockLogger ,
250
+ } ) ;
231
251
232
252
module . onDidRegisterHandlers ( ) ;
233
253
@@ -259,7 +279,10 @@ describe('AutoFixModule', () => {
259
279
mockContext . getFixes . mockResolvedValue ( [ TextEdit . insert ( Position . create ( 0 , 0 ) , 'text' ) ] ) ;
260
280
mockContext . connection . workspace . applyEdit . mockRejectedValue ( error ) ;
261
281
262
- const module = new AutoFixModule ( { context : mockContext . __typed ( ) , logger : mockLogger } ) ;
282
+ const module = new AutoFixModule ( {
283
+ context : mockContext . __typed ( ) ,
284
+ logger : mockLogger ,
285
+ } ) ;
263
286
264
287
module . onDidRegisterHandlers ( ) ;
265
288
@@ -284,14 +307,20 @@ describe('AutoFixModule', () => {
284
307
} ) ;
285
308
286
309
it ( 'should be disposable' , ( ) => {
287
- const module = new AutoFixModule ( { context : mockContext . __typed ( ) , logger : mockLogger } ) ;
310
+ const module = new AutoFixModule ( {
311
+ context : mockContext . __typed ( ) ,
312
+ logger : mockLogger ,
313
+ } ) ;
288
314
289
315
expect ( module ) . toHaveProperty ( 'dispose' ) ;
290
316
expect ( module . dispose ) . toBeInstanceOf ( Function ) ;
291
317
} ) ;
292
318
293
319
it ( 'should dispose all handler registrations when disposed' , ( ) => {
294
- const module = new AutoFixModule ( { context : mockContext . __typed ( ) , logger : mockLogger } ) ;
320
+ const module = new AutoFixModule ( {
321
+ context : mockContext . __typed ( ) ,
322
+ logger : mockLogger ,
323
+ } ) ;
295
324
296
325
module . onDidRegisterHandlers ( ) ;
297
326
module . dispose ( ) ;
0 commit comments