Add main controller tests for a few extensions (#11307)

* add a few tests

* fix errors

* undo change

* move registering commands to extension.ts for dacpac and schema compare

* undo createController() addition

* fix whitespace
This commit is contained in:
Kim Santiago
2020-07-13 09:59:12 -07:00
committed by GitHub
parent 1e62030581
commit 347c193455
12 changed files with 39 additions and 157 deletions

View File

@@ -65,4 +65,16 @@ describe('MainController: main controller operations', function (): void {
const controller = new MainController(testContext.context, testContext.apiWrapper.object);
await shouldThrowSpecificError(async () => await controller.createNewProject(), constants.projectLocationRequired);
});
it('Should create new instance without error', async function (): Promise<void> {
should.doesNotThrow(() => new MainController(testContext.context, testContext.apiWrapper.object), 'Creating controller should not throw an error');
});
it('Should activate and deactivate without error', async function (): Promise<void> {
let controller = new MainController(testContext.context, testContext.apiWrapper.object);
should.notEqual(controller.extensionContext, undefined);
should.doesNotThrow(() => controller.activate(), 'activate() should not throw an error');
should.doesNotThrow(() => controller.dispose(), 'dispose() should not throw an error');
});
});