File tree Expand file tree Collapse file tree 2 files changed +3
-26
lines changed Expand file tree Collapse file tree 2 files changed +3
-26
lines changed Original file line number Diff line number Diff line change 3
3
4
4
'use strict' ;
5
5
6
- import * as fs from 'fs' ;
7
- import * as path from 'path' ;
8
6
import * as tmp from 'tmp' ;
9
7
10
- export function getSubDirectories ( rootDir : string ) : Promise < string [ ] > {
11
- return new Promise < string [ ] > ( resolve => {
12
- fs . readdir ( rootDir , ( error , files ) => {
13
- if ( error ) {
14
- return resolve ( [ ] ) ;
15
- }
16
- const subDirs : string [ ] = [ ] ;
17
- files . forEach ( name => {
18
- const fullPath = path . join ( rootDir , name ) ;
19
- try {
20
- if ( fs . statSync ( fullPath ) . isDirectory ( ) ) {
21
- subDirs . push ( fullPath ) ;
22
- }
23
- }
24
- // tslint:disable-next-line:no-empty one-line
25
- catch ( ex ) { }
26
- } ) ;
27
- resolve ( subDirs ) ;
28
- } ) ;
29
- } ) ;
30
- }
31
-
32
8
export function createTemporaryFile ( extension : string , temporaryDirectory ?: string ) : Promise < { filePath : string ; cleanupCallback : Function } > {
33
9
// tslint:disable-next-line:no-any
34
10
const options : any = { postfix : extension } ;
Original file line number Diff line number Diff line change 1
1
import * as path from 'path' ;
2
2
import { OutputChannel , QuickPickItem , Uri } from 'vscode' ;
3
3
import { IApplicationShell } from '../../../common/application/types' ;
4
+ import { IFileSystem } from '../../../common/platform/types' ;
4
5
import { IInstaller , ILogger , IOutputChannel } from '../../../common/types' ;
5
6
import { createDeferred } from '../../../common/utils/async' ;
6
- import { getSubDirectories } from '../../../common/utils/fs' ;
7
7
import { IServiceContainer } from '../../../ioc/types' ;
8
8
import { ITestConfigSettingsService , ITestConfigurationManager } from '../../types' ;
9
9
import { TEST_OUTPUT_CHANNEL , UNIT_TEST_PRODUCTS } from '../constants' ;
@@ -101,7 +101,8 @@ export abstract class TestConfigurationManager implements ITestConfigurationMana
101
101
return def . promise ;
102
102
}
103
103
protected getTestDirs ( rootDir : string ) : Promise < string [ ] > {
104
- return getSubDirectories ( rootDir ) . then ( subDirs => {
104
+ const fs = this . serviceContainer . get < IFileSystem > ( IFileSystem ) ;
105
+ return fs . getSubDirectories ( rootDir ) . then ( subDirs => {
105
106
subDirs . sort ( ) ;
106
107
107
108
// Find out if there are any dirs with the name test and place them on the top.
You can’t perform that action at this time.
0 commit comments