6
6
import { expect } from 'chai' ;
7
7
import * as typemoq from 'typemoq' ;
8
8
import { EventEmitter , Uri } from 'vscode' ;
9
- import { IExtensionSingleActivationService } from '../../../../client/activation/types' ;
10
9
import { BaseDiagnosticsService } from '../../../../client/application/diagnostics/base' ;
11
10
import { InvalidLaunchJsonDebuggerDiagnostic } from '../../../../client/application/diagnostics/checks/invalidLaunchJsonDebugger' ;
12
11
import {
@@ -24,7 +23,6 @@ import {
24
23
IDiagnostic ,
25
24
IDiagnosticCommand ,
26
25
IDiagnosticHandlerService ,
27
- IDiagnosticsService ,
28
26
} from '../../../../client/application/diagnostics/types' ;
29
27
import { CommandsWithoutArgs } from '../../../../client/common/application/commands' ;
30
28
import { ICommandManager , IWorkspaceService } from '../../../../client/common/application/types' ;
@@ -39,7 +37,7 @@ import { EnvironmentType, PythonEnvironment } from '../../../../client/pythonEnv
39
37
import { sleep } from '../../../core' ;
40
38
41
39
suite ( 'Application Diagnostics - Checks Python Interpreter' , ( ) => {
42
- let diagnosticService : IDiagnosticsService & IExtensionSingleActivationService ;
40
+ let diagnosticService : InvalidPythonInterpreterService ;
43
41
let messageHandler : typemoq . IMock < IDiagnosticHandlerService < MessageCommandPrompt > > ;
44
42
let commandFactory : typemoq . IMock < IDiagnosticsCommandFactory > ;
45
43
let interpreterService : typemoq . IMock < IInterpreterService > ;
@@ -157,6 +155,11 @@ suite('Application Diagnostics - Checks Python Interpreter', () => {
157
155
}
158
156
} ) ;
159
157
158
+ test ( 'Should return empty diagnostics' , async ( ) => {
159
+ const diagnostics = await diagnosticService . diagnose ( undefined ) ;
160
+ expect ( diagnostics ) . to . be . deep . equal ( [ ] , 'not the same' ) ;
161
+ } ) ;
162
+
160
163
test ( 'Should return diagnostics if there are no interpreters after double-checking' , async ( ) => {
161
164
interpreterService
162
165
. setup ( ( i ) => i . hasInterpreters ( ) )
@@ -167,7 +170,7 @@ suite('Application Diagnostics - Checks Python Interpreter', () => {
167
170
. returns ( ( ) => [ ] )
168
171
. verifiable ( typemoq . Times . once ( ) ) ;
169
172
170
- const diagnostics = await diagnosticService . diagnose ( undefined ) ;
173
+ const diagnostics = await diagnosticService . _manualDiagnose ( undefined ) ;
171
174
expect ( diagnostics ) . to . be . deep . equal (
172
175
[
173
176
new InvalidPythonInterpreterDiagnostic (
@@ -192,7 +195,7 @@ suite('Application Diagnostics - Checks Python Interpreter', () => {
192
195
} )
193
196
. verifiable ( typemoq . Times . once ( ) ) ;
194
197
195
- const diagnostics = await diagnosticService . diagnose ( undefined ) ;
198
+ const diagnostics = await diagnosticService . _manualDiagnose ( undefined ) ;
196
199
expect ( diagnostics ) . to . be . deep . equal (
197
200
[
198
201
new InvalidPythonInterpreterDiagnostic (
@@ -217,7 +220,7 @@ suite('Application Diagnostics - Checks Python Interpreter', () => {
217
220
} )
218
221
. verifiable ( typemoq . Times . once ( ) ) ;
219
222
220
- const diagnostics = await diagnosticService . diagnose ( undefined ) ;
223
+ const diagnostics = await diagnosticService . _manualDiagnose ( undefined ) ;
221
224
expect ( diagnostics ) . to . be . deep . equal ( [ ] , 'not the same' ) ;
222
225
interpreterService . verifyAll ( ) ;
223
226
} ) ;
0 commit comments