Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/debug/test/browser/mockDebugModel.ts
5228 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { DisposableStore } from '../../../../../base/common/lifecycle.js';
7
import { upcastPartial } from '../../../../../base/test/common/mock.js';
8
import { NullLogService } from '../../../../../platform/log/common/log.js';
9
import { UriIdentityService } from '../../../../../platform/uriIdentity/common/uriIdentityService.js';
10
import { ITextFileService } from '../../../../services/textfile/common/textfiles.js';
11
import { TestFileService, TestStorageService } from '../../../../test/common/workbenchTestServices.js';
12
import { DebugModel } from '../../common/debugModel.js';
13
import { MockDebugStorage } from '../common/mockDebug.js';
14
15
const fileService = new TestFileService();
16
export const mockUriIdentityService = new UriIdentityService(fileService);
17
18
export function createMockDebugModel(disposable: Pick<DisposableStore, 'add'>): DebugModel {
19
const storage = disposable.add(new TestStorageService());
20
const debugStorage = disposable.add(new MockDebugStorage(storage));
21
return disposable.add(new DebugModel(debugStorage, upcastPartial<ITextFileService>({ isDirty: (e: unknown) => false }), mockUriIdentityService, new NullLogService()));
22
}
23
24