mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Potentially fixes the test percentage (#11974)
* Potentially fixes the test percentage * PR feedback
This commit is contained in:
@@ -16,7 +16,7 @@ export default abstract class ControllerBase implements vscode.Disposable {
|
|||||||
return this._context;
|
return this._context;
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract activate(): Promise<boolean>;
|
abstract activate(): Promise<void>;
|
||||||
|
|
||||||
abstract deactivate(): void;
|
abstract deactivate(): void;
|
||||||
|
|
||||||
|
|||||||
@@ -29,14 +29,17 @@ export default class MainController extends ControllerBase {
|
|||||||
public deactivate(): void {
|
public deactivate(): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async activate(): Promise<boolean> {
|
public async activate(): Promise<void> {
|
||||||
return new Promise<boolean>(async (resolve) => {
|
const registerFileProviderPromise = new Promise<boolean>(async (resolve) => {
|
||||||
managerInstance.onRegisteredApi<FlatFileProvider>(ApiType.FlatFileProvider)(provider => {
|
managerInstance.onRegisteredApi<FlatFileProvider>(ApiType.FlatFileProvider)(provider => {
|
||||||
this.initializeFlatFileProvider(provider);
|
this.initializeFlatFileProvider(provider);
|
||||||
resolve(true);
|
resolve(true);
|
||||||
});
|
});
|
||||||
await new ServiceClient(this._outputChannel).startService(this._context);
|
|
||||||
});
|
});
|
||||||
|
const serviceClient = new ServiceClient(this._outputChannel);
|
||||||
|
const serviceStartPromise = serviceClient.startService(this._context);
|
||||||
|
|
||||||
|
await Promise.all([registerFileProviderPromise, serviceStartPromise]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
import MainController from '../../controllers/mainController';
|
import MainController from '../../controllers/mainController';
|
||||||
import { ImportTestUtils, TestExtensionContext } from '../utils.test';
|
import { ImportTestUtils, TestExtensionContext } from '../utils.test';
|
||||||
import * as should from 'should';
|
|
||||||
|
|
||||||
describe('Main Controller', function () {
|
describe('Main Controller', function () {
|
||||||
let testExtensionContext: TestExtensionContext;
|
let testExtensionContext: TestExtensionContext;
|
||||||
@@ -16,7 +15,7 @@ describe('Main Controller', function () {
|
|||||||
|
|
||||||
it('Extension activates successfully', async function () {
|
it('Extension activates successfully', async function () {
|
||||||
let mainController = new MainController(testExtensionContext);
|
let mainController = new MainController(testExtensionContext);
|
||||||
should.doesNotThrow(() => mainController.activate());
|
await mainController.activate().should.not.be.rejected();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user