mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-02 01:25:39 -05:00
Fix service dependency startup warning (#14180)
* Fix service dependency startup warning * fix tests
This commit is contained in:
@@ -50,7 +50,6 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
|
||||
// CONSTRUCTOR /////////////////////////////////////////////////////////
|
||||
constructor(
|
||||
private _mementoObj: object,
|
||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||
@IStorageService private _storageService: IStorageService,
|
||||
@IClipboardService private _clipboardService: IClipboardService,
|
||||
@@ -58,12 +57,9 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
@ILogService private readonly _logService: ILogService,
|
||||
@INotificationService private readonly _notificationService: INotificationService
|
||||
) {
|
||||
// Create the account store
|
||||
if (!this._mementoObj) {
|
||||
this._mementoContext = new Memento(AccountManagementService.ACCOUNT_MEMENTO, this._storageService);
|
||||
this._mementoObj = this._mementoContext.getMemento(StorageScope.GLOBAL);
|
||||
}
|
||||
this._accountStore = this._instantiationService.createInstance(AccountStore, this._mementoObj);
|
||||
this._mementoContext = new Memento(AccountManagementService.ACCOUNT_MEMENTO, this._storageService);
|
||||
const mementoObj = this._mementoContext.getMemento(StorageScope.GLOBAL);
|
||||
this._accountStore = this._instantiationService.createInstance(AccountStore, mementoObj);
|
||||
|
||||
// Setup the event emitters
|
||||
this._addAccountProviderEmitter = new Emitter<AccountProviderAddedEventParams>();
|
||||
|
||||
@@ -214,7 +214,7 @@ suite('Account Management Service Tests:', () => {
|
||||
// If: I add an account when the provider doesn't exist
|
||||
// Then: It should not resolve
|
||||
return Promise.race([
|
||||
new Promise((resolve, reject) => setTimeout(() => resolve(), 100)),
|
||||
new Promise<void>((resolve, reject) => setTimeout(() => resolve(), 100)),
|
||||
ams.addAccount('doesNotExist').then(() => { throw new Error('Promise resolved when the provider did not exist'); })
|
||||
]);
|
||||
});
|
||||
@@ -283,7 +283,7 @@ suite('Account Management Service Tests:', () => {
|
||||
// If: I get accounts when the provider doesn't exist
|
||||
// Then: It should not resolve
|
||||
return Promise.race([
|
||||
new Promise((resolve, reject) => setTimeout(() => resolve(), 100)),
|
||||
new Promise<void>((resolve, reject) => setTimeout(() => resolve(), 100)),
|
||||
ams.getAccountsForProvider('doesNotExist').then(() => { throw new Error('Promise resolved when the provider did not exist'); })
|
||||
]);
|
||||
});
|
||||
@@ -529,13 +529,10 @@ function getTestState(): AccountManagementState {
|
||||
mockInstantiationService.setup(x => x.createInstance(TypeMoq.It.isValue(AccountStore), TypeMoq.It.isAny()))
|
||||
.returns(() => mockAccountStore.object);
|
||||
|
||||
// Create mock memento
|
||||
let mockMemento = {};
|
||||
|
||||
const testNotificationService = new TestNotificationService();
|
||||
|
||||
// Create the account management service
|
||||
let ams = new AccountManagementService(mockMemento, mockInstantiationService.object, new TestStorageService(), undefined!, undefined!, undefined!, testNotificationService);
|
||||
let ams = new AccountManagementService(mockInstantiationService.object, new TestStorageService(), undefined!, undefined!, undefined!, testNotificationService);
|
||||
|
||||
// Wire up event handlers
|
||||
let evUpdate = new EventVerifierSingle<UpdateAccountListEventParams>();
|
||||
|
||||
Reference in New Issue
Block a user