3
3
import { expect } from 'chai' ;
4
4
import * as path from 'path' ;
5
5
import { SemVer } from 'semver' ;
6
+ import { instance , mock } from 'ts-mockito' ;
6
7
import * as TypeMoq from 'typemoq' ;
7
8
import { ConfigurationTarget , Uri , WorkspaceConfiguration } from 'vscode' ;
8
9
import { IWorkspaceService } from '../../client/common/application/types' ;
@@ -20,7 +21,8 @@ import { PlatformService } from '../../client/common/platform/platformService';
20
21
import { IFileSystem , IPlatformService } from '../../client/common/platform/types' ;
21
22
import { CurrentProcess } from '../../client/common/process/currentProcess' ;
22
23
import { IProcessServiceFactory , IPythonExecutionFactory } from '../../client/common/process/types' ;
23
- import { ITerminalService , ITerminalServiceFactory } from '../../client/common/terminal/types' ;
24
+ import { TerminalHelper } from '../../client/common/terminal/helper' ;
25
+ import { ITerminalHelper , ITerminalService , ITerminalServiceFactory } from '../../client/common/terminal/types' ;
24
26
import { IConfigurationService , ICurrentProcess , IInstaller , ILogger , IPathUtils , IPersistentStateFactory , IPythonSettings , IsWindows } from '../../client/common/types' ;
25
27
import { Architecture } from '../../client/common/utils/platform' ;
26
28
import { ICondaService , IInterpreterLocatorService , IInterpreterService , INTERPRETER_LOCATOR_SERVICE , InterpreterType , PIPENV_SERVICE , PythonInterpreter } from '../../client/interpreter/contracts' ;
@@ -132,6 +134,7 @@ suite('Module Installer', () => {
132
134
mockInterpreterLocator . setup ( p => p . getInterpreters ( TypeMoq . It . isAny ( ) ) ) . returns ( ( ) => Promise . resolve ( [ ] ) ) ;
133
135
ioc . serviceManager . addSingletonInstance < IInterpreterLocatorService > ( IInterpreterLocatorService , mockInterpreterLocator . object , INTERPRETER_LOCATOR_SERVICE ) ;
134
136
ioc . serviceManager . addSingletonInstance < IInterpreterLocatorService > ( IInterpreterLocatorService , TypeMoq . Mock . ofType < IInterpreterLocatorService > ( ) . object , PIPENV_SERVICE ) ;
137
+ ioc . serviceManager . addSingletonInstance < ITerminalHelper > ( ITerminalHelper , instance ( mock ( TerminalHelper ) ) ) ;
135
138
136
139
const processService = await ioc . serviceContainer . get < IProcessServiceFactory > ( IProcessServiceFactory ) . create ( ) as MockProcessService ;
137
140
processService . onExec ( ( file , args , options , callback ) => {
@@ -167,6 +170,7 @@ suite('Module Installer', () => {
167
170
] ) ) ;
168
171
ioc . serviceManager . addSingletonInstance < IInterpreterLocatorService > ( IInterpreterLocatorService , mockInterpreterLocator . object , INTERPRETER_LOCATOR_SERVICE ) ;
169
172
ioc . serviceManager . addSingletonInstance < IInterpreterLocatorService > ( IInterpreterLocatorService , TypeMoq . Mock . ofType < IInterpreterLocatorService > ( ) . object , PIPENV_SERVICE ) ;
173
+ ioc . serviceManager . addSingletonInstance < ITerminalHelper > ( ITerminalHelper , instance ( mock ( TerminalHelper ) ) ) ;
170
174
171
175
const processService = await ioc . serviceContainer . get < IProcessServiceFactory > ( IProcessServiceFactory ) . create ( ) as MockProcessService ;
172
176
processService . onExec ( ( file , args , options , callback ) => {
0 commit comments