@@ -284,7 +284,7 @@ suite('Linter Availability Provider tests', () => {
284284 . verifiable ( TypeMoq . Times . once ( ) ) ; 
285285 fsMock . setup ( fs  =>  fs . fileExists ( TypeMoq . It . isAny ( ) ) ) 
286286 . returns ( async  ( )  =>  options . linterIsInstalled ) 
287-  . verifiable ( TypeMoq . Times . once ( ) ) ; 
287+  . verifiable ( TypeMoq . Times . atLeastOnce ( ) ) ; 
288288
289289 setupConfigurationServiceForJediSettingsTest ( options . jediEnabledValue ,  configServiceMock ) ; 
290290 setupWorkspaceMockForLinterConfiguredTests ( 
@@ -413,7 +413,7 @@ suite('Linter Availability Provider tests', () => {
413413
414414 // perform test 
415415 const  availabilityProvider  =  new  AvailableLinterActivator ( appShellMock . object ,  fsMock . object ,  workspaceServiceMock . object ,  configServiceMock . object ,  factoryMock . object ) ; 
416-  const  result  =  await  availabilityProvider . isLinterAvailable ( linterInfo . product ) ; 
416+  const  result  =  await  availabilityProvider . isLinterAvailable ( linterInfo ) ; 
417417
418418 expect ( result ) . to . equal ( expectedResult ,  'Expected promptToConfigureAvailableLinter to return true because the configuration was updated.' ) ; 
419419 fsMock . verifyAll ( ) ; 
@@ -431,37 +431,7 @@ suite('Linter Availability Provider tests', () => {
431431
432432 // perform test 
433433 const  availabilityProvider  =  new  AvailableLinterActivator ( appShellMock . object ,  fsMock . object ,  workspaceServiceMock . object ,  configServiceMock . object ,  factoryMock . object ) ; 
434-  const  result  =  await  availabilityProvider . isLinterAvailable ( linterInfo . product ) ; 
435- 
436-  expect ( result ) . to . equal ( expectedResult ,  'Expected promptToConfigureAvailableLinter to return true because the configuration was updated.' ) ; 
437-  fsMock . verifyAll ( ) ; 
438-  workspaceServiceMock . verifyAll ( ) ; 
439-  } ) ; 
440- 
441-  test ( 'Discovery of linter is available in the environment returns false when it fails' ,  async  ( )  =>  { 
442-  // set expectations 
443-  const  expectedResult  =  false ; 
444- 
445-  // arrange 
446-  const  [ appShellMock ,  fsMock ,  workspaceServiceMock ,  configServiceMock ,  factoryMock ,  linterInfo ]  =  getDependenciesForAvailabilityTests ( ) ; 
447-  const  workspaceFolder  =  {  uri : Uri . parse ( 'full/path/to/workspace' ) ,  name : '' ,  index : 0  } ; 
448-  workspaceServiceMock 
449-  . setup ( c  =>  c . hasWorkspaceFolders ) 
450-  . returns ( ( )  =>  true ) 
451-  . verifiable ( TypeMoq . Times . once ( ) ) ; 
452-  workspaceServiceMock 
453-  . setup ( c  =>  c . workspaceFolders ) 
454-  . returns ( ( )  =>  [ workspaceFolder ] ) ; 
455-  workspaceServiceMock 
456-  . setup ( c  =>  c . getWorkspaceFolder ( TypeMoq . It . isAny ( ) ) ) 
457-  . returns ( ( )  =>  workspaceFolder ) ; 
458-  fsMock . setup ( fs  =>  fs . fileExists ( TypeMoq . It . isAny ( ) ) ) 
459-  . returns ( async  ( )  =>  Promise . reject ( 'error testfail' ) ) 
460-  . verifiable ( TypeMoq . Times . once ( ) ) ; 
461- 
462-  // perform test 
463-  const  availabilityProvider  =  new  AvailableLinterActivator ( appShellMock . object ,  fsMock . object ,  workspaceServiceMock . object ,  configServiceMock . object ,  factoryMock . object ) ; 
464-  const  result  =  await  availabilityProvider . isLinterAvailable ( linterInfo . product ) ; 
434+  const  result  =  await  availabilityProvider . isLinterAvailable ( linterInfo ) ; 
465435
466436 expect ( result ) . to . equal ( expectedResult ,  'Expected promptToConfigureAvailableLinter to return true because the configuration was updated.' ) ; 
467437 fsMock . verifyAll ( ) ; 
@@ -532,8 +502,8 @@ function setupInstallerForAvailabilityTest(_linterInfo: LinterInfo, linterIsInst
532502 . setup ( c  =>  c . getWorkspaceFolder ( TypeMoq . It . isAny ( ) ) ) 
533503 . returns ( ( )  =>  workspaceFolder ) ; 
534504 fsMock . setup ( fs  =>  fs . fileExists ( TypeMoq . It . isAny ( ) ) ) 
535-  . returns ( async   ( )  =>  linterIsInstalled ) 
536-  . verifiable ( TypeMoq . Times . once ( ) ) ; 
505+  . returns ( ( )  =>  Promise . resolve ( linterIsInstalled ) ) 
506+  . verifiable ( TypeMoq . Times . atLeastOnce ( ) ) ; 
537507
538508 return  fsMock ; 
539509} 
0 commit comments