mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -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;
|
||||
}
|
||||
|
||||
abstract activate(): Promise<boolean>;
|
||||
abstract activate(): Promise<void>;
|
||||
|
||||
abstract deactivate(): void;
|
||||
|
||||
|
||||
@@ -29,14 +29,17 @@ export default class MainController extends ControllerBase {
|
||||
public deactivate(): void {
|
||||
}
|
||||
|
||||
public async activate(): Promise<boolean> {
|
||||
return new Promise<boolean>(async (resolve) => {
|
||||
public async activate(): Promise<void> {
|
||||
const registerFileProviderPromise = new Promise<boolean>(async (resolve) => {
|
||||
managerInstance.onRegisteredApi<FlatFileProvider>(ApiType.FlatFileProvider)(provider => {
|
||||
this.initializeFlatFileProvider(provider);
|
||||
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 { ImportTestUtils, TestExtensionContext } from '../utils.test';
|
||||
import * as should from 'should';
|
||||
|
||||
describe('Main Controller', function () {
|
||||
let testExtensionContext: TestExtensionContext;
|
||||
@@ -16,7 +15,7 @@ describe('Main Controller', function () {
|
||||
|
||||
it('Extension activates successfully', async function () {
|
||||
let mainController = new MainController(testExtensionContext);
|
||||
should.doesNotThrow(() => mainController.activate());
|
||||
await mainController.activate().should.not.be.rejected();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user