55
66import { expect } from 'chai' ;
77import * as path from 'path' ;
8- import { anything , instance , mock , verify , when } from 'ts-mockito' ;
8+ import { instance , mock , verify , when } from 'ts-mockito' ;
99import * as typemoq from 'typemoq' ;
1010import { TreeItemCollapsibleState , Uri } from 'vscode' ;
1111import { CommandManager } from '../../../client/common/application/commandManager' ;
1212import { WorkspaceService } from '../../../client/common/application/workspace' ;
1313import { Commands } from '../../../client/common/constants' ;
14- import { FileSystem } from '../../../client/common/platform/fileSystem' ;
15- import { IFileSystem } from '../../../client/common/platform/types' ;
1614import { IDisposable } from '../../../client/common/types' ;
1715import { CommandSource } from '../../../client/testing/common/constants' ;
1816import { TestCollectionStorageService } from '../../../client/testing/common/services/storageService' ;
@@ -708,23 +706,20 @@ suite('Unit Tests Test Explorer TestTreeViewProvider', () => {
708706 } ) ;
709707 suite ( 'Root Nodes' , ( ) => {
710708 let treeProvider : TestTreeViewProvider ;
711- let fs : IFileSystem ;
712709 setup ( ( ) => {
713710 const store = mock ( TestCollectionStorageService ) ;
714711 const managementService = mock ( UnitTestManagementService ) ;
715712 when ( managementService . onDidStatusChange ) . thenReturn ( noop as any ) ;
716713 when ( store . onDidChange ) . thenReturn ( noop as any ) ;
717714 const workspace = mock ( WorkspaceService ) ;
718715 when ( workspace . onDidChangeWorkspaceFolders ) . thenReturn ( noop as any ) ;
719- fs = mock ( FileSystem ) ;
720- when ( fs . arePathsSame ( anything ( ) , anything ( ) ) ) . thenCall ( ( path1 : string , path2 : string ) => path1 === path2 ) ;
721716 const commandManager = mock ( CommandManager ) ;
722717 treeProvider = new TestTreeViewProvider ( instance ( store ) , instance ( managementService ) ,
723- instance ( workspace ) , instance ( commandManager ) , instance ( fs ) , [ ] ) ;
718+ instance ( workspace ) , instance ( commandManager ) , [ ] ) ;
724719
725720 } ) ;
726721 test ( 'The root folder will not be displayed if there are no tests' , async ( ) => {
727- const children = await treeProvider . getRootNodes ( ) ;
722+ const children = treeProvider . getRootNodes ( ) ;
728723
729724 expect ( children ) . to . deep . equal ( [ ] ) ;
730725 } ) ;
@@ -745,7 +740,7 @@ suite('Unit Tests Test Explorer TestTreeViewProvider', () => {
745740 testFolders : [ ] ,
746741 testSuites : [ ]
747742 } ;
748- const children = await treeProvider . getRootNodes ( tests ) ;
743+ const children = treeProvider . getRootNodes ( tests ) ;
749744
750745 expect ( children ) . to . deep . equal ( [ ] ) ;
751746 } ) ;
@@ -803,7 +798,7 @@ suite('Unit Tests Test Explorer TestTreeViewProvider', () => {
803798 folders : [ child1Folder ] ,
804799 name : rootFolderPath ,
805800 nameToRun : 'child' ,
806- testFiles : [ ] ,
801+ testFiles : [ file1 , file2 ] ,
807802 time : 0 ,
808803 resource : Uri . file ( __filename )
809804 } ;
@@ -815,7 +810,7 @@ suite('Unit Tests Test Explorer TestTreeViewProvider', () => {
815810 testFolders : [ rootFolder , child1Folder , child2Folder ] ,
816811 testSuites : [ ]
817812 } ;
818- const children = await treeProvider . getRootNodes ( tests ) ;
813+ const children = treeProvider . getRootNodes ( tests ) ;
819814
820815 expect ( children ) . to . be . lengthOf ( 3 ) ;
821816 expect ( children ) . to . deep . equal ( [ file1 , file2 , child1Folder ] ) ;
@@ -886,7 +881,7 @@ suite('Unit Tests Test Explorer TestTreeViewProvider', () => {
886881 testFolders : [ child3Folder , child1Folder , child2Folder ] ,
887882 testSuites : [ ]
888883 } ;
889- const children = await treeProvider . getRootNodes ( tests ) ;
884+ const children = treeProvider . getRootNodes ( tests ) ;
890885
891886 expect ( children ) . to . be . lengthOf ( 2 ) ;
892887 expect ( children ) . to . deep . equal ( [ child1Folder , child3Folder ] ) ;
0 commit comments