@@ -12,6 +12,7 @@ import { DebugConfigurationManager } from '@opensumi/ide-debug/lib/browser/debug
1212import { DebugPreferences } from '@opensumi/ide-debug/lib/browser/debug-preferences' ;
1313import { createBrowserInjector } from '@opensumi/ide-dev-tool/src/injector-helper' ;
1414import { WorkbenchEditorService } from '@opensumi/ide-editor' ;
15+ import { IEditorDocumentModelService } from '@opensumi/ide-editor/lib/browser' ;
1516import { IFileServiceClient } from '@opensumi/ide-file-service' ;
1617import { IWorkspaceService } from '@opensumi/ide-workspace' ;
1718
@@ -35,6 +36,11 @@ describe('Debug Configuration Manager', () => {
3536 const mockMonacoEditorModel = {
3637 getLineLastNonWhitespaceColumn : jest . fn ( ) ,
3738 getPositionAt : jest . fn ( ( ) => 1 ) ,
39+ getValue : jest . fn (
40+ ( ) => `{
41+ "version": "0.2.0",
42+ "configurations": [` ,
43+ ) ,
3844 } ;
3945
4046 const mockMonacoEditor = {
@@ -165,6 +171,21 @@ describe('Debug Configuration Manager', () => {
165171 useValue : ( ) => mockDebugStorage ,
166172 } ) ;
167173
174+ mockInjector . overrideProviders ( {
175+ token : IEditorDocumentModelService ,
176+ useValue : {
177+ createModelReference : ( uri ) => ( {
178+ instance : {
179+ uri,
180+ getMonacoModel : ( ) => ( {
181+ getValue : jest . fn ( ( ) => '' ) ,
182+ } ) ,
183+ } ,
184+ dispose : jest . fn ( ) ,
185+ } ) ,
186+ } ,
187+ } ) ;
188+
168189 debugConfigurationManager = mockInjector . get ( DebugConfigurationManager ) ;
169190
170191 await debugConfigurationManager . whenReady ;
0 commit comments