@@ -157,7 +157,6 @@ describe('gocodeprovider', () => {
157
157
} )
158
158
159
159
it ( 'provides the exported types of the unimported package' , ( ) => {
160
- let suggestions = null
161
160
waitsFor ( ( ) => provider . allPkgs . size > 0 )
162
161
163
162
runs ( ( ) => {
@@ -176,9 +175,10 @@ describe('gocodeprovider', () => {
176
175
} )
177
176
178
177
runs ( async ( ) => {
179
- suggestions = await suggestionsPromise
180
178
expect ( provider . getSuggestions ) . toHaveBeenCalled ( )
181
179
expect ( provider . getSuggestions . calls . length ) . toBe ( 1 )
180
+
181
+ const suggestions = await suggestionsPromise
182
182
expect ( suggestions ) . toBeTruthy ( )
183
183
expect ( suggestions . length ) . toBeGreaterThan ( 0 )
184
184
expect ( suggestions [ 0 ] ) . toBeTruthy ( )
@@ -250,7 +250,6 @@ describe('gocodeprovider', () => {
250
250
} )
251
251
252
252
describe ( 'when the go-plus-issue-307 file is opened' , ( ) => {
253
- let suggestions = null
254
253
beforeEach ( async ( ) => {
255
254
editor = await atom . workspace . open (
256
255
'go-plus-issue-307' + path . sep + 'main.go'
@@ -262,7 +261,6 @@ describe('gocodeprovider', () => {
262
261
runs ( ( ) => {
263
262
editor . setCursorScreenPosition ( [ 13 , 0 ] )
264
263
editor . insertText ( '\tSayHello("world")' )
265
- suggestions = null
266
264
suggestionsPromise = null
267
265
advanceClock ( completionDelay )
268
266
@@ -280,10 +278,10 @@ describe('gocodeprovider', () => {
280
278
} )
281
279
282
280
runs ( async ( ) => {
283
- suggestions = await suggestionsPromise
284
-
285
281
expect ( provider . getSuggestions ) . toHaveBeenCalled ( )
286
282
expect ( provider . getSuggestions . calls . length ) . toBe ( 1 )
283
+
284
+ const suggestions = await suggestionsPromise
287
285
expect ( suggestions ) . toBeTruthy ( )
288
286
expect ( suggestions . length ) . toBeGreaterThan ( 0 )
289
287
expect ( suggestions [ 0 ] ) . toBeTruthy ( )
@@ -299,7 +297,6 @@ describe('gocodeprovider', () => {
299
297
runs ( ( ) => {
300
298
editor . setCursorScreenPosition ( [ 13 , 0 ] )
301
299
editor . insertText ( '\tSayHello("world") ' )
302
- suggestions = null
303
300
suggestionsPromise = null
304
301
advanceClock ( completionDelay )
305
302
@@ -317,10 +314,10 @@ describe('gocodeprovider', () => {
317
314
} )
318
315
319
316
runs ( async ( ) => {
320
- suggestions = await suggestionsPromise
321
-
322
317
expect ( provider . getSuggestions ) . toHaveBeenCalled ( )
323
318
expect ( provider . getSuggestions . calls . length ) . toBe ( 1 )
319
+
320
+ const suggestions = await suggestionsPromise
324
321
expect ( suggestions ) . toBeTruthy ( )
325
322
expect ( suggestions . length ) . toBeGreaterThan ( 0 )
326
323
expect ( suggestions [ 0 ] ) . toBeTruthy ( )
@@ -336,7 +333,6 @@ describe('gocodeprovider', () => {
336
333
runs ( ( ) => {
337
334
editor . setCursorScreenPosition ( [ 13 , 0 ] )
338
335
editor . insertText ( '\tSayHello("world") ' )
339
- suggestions = null
340
336
suggestionsPromise = null
341
337
advanceClock ( completionDelay )
342
338
@@ -354,10 +350,10 @@ describe('gocodeprovider', () => {
354
350
} )
355
351
356
352
runs ( async ( ) => {
357
- suggestions = await suggestionsPromise
358
-
359
353
expect ( provider . getSuggestions ) . toHaveBeenCalled ( )
360
354
expect ( provider . getSuggestions . calls . length ) . toBe ( 1 )
355
+
356
+ const suggestions = await suggestionsPromise
361
357
expect ( suggestions ) . toBeTruthy ( )
362
358
expect ( suggestions . length ) . toBeGreaterThan ( 0 )
363
359
expect ( suggestions [ 0 ] ) . toBeTruthy ( )
@@ -375,7 +371,6 @@ describe('gocodeprovider', () => {
375
371
runs ( ( ) => {
376
372
editor . setCursorScreenPosition ( [ 13 , 0 ] )
377
373
editor . insertText ( '\tSayHello("world")\t' )
378
- suggestions = null
379
374
suggestionsPromise = null
380
375
advanceClock ( completionDelay )
381
376
@@ -394,7 +389,7 @@ describe('gocodeprovider', () => {
394
389
} )
395
390
396
391
runs ( async ( ) => {
397
- suggestions = await suggestionsPromise
392
+ const suggestions = await suggestionsPromise
398
393
399
394
expect ( provider . getSuggestions ) . toHaveBeenCalled ( )
400
395
expect ( provider . getSuggestions . calls . length ) . toBe ( 1 )
0 commit comments