diff --git a/extensions/sql-database-projects/src/dialogs/publishDatabaseDialog.ts b/extensions/sql-database-projects/src/dialogs/publishDatabaseDialog.ts index 6ddc305478..773d86e817 100644 --- a/extensions/sql-database-projects/src/dialogs/publishDatabaseDialog.ts +++ b/extensions/sql-database-projects/src/dialogs/publishDatabaseDialog.ts @@ -253,7 +253,7 @@ export class PublishDatabaseDialog { }).component(); this.connectionsRadioButton.checked = true; - this.connectionsRadioButton.onDidClick(async () => { + this.connectionsRadioButton.onDidClick(() => { this.formBuilder!.removeFormItem(this.dataSourcesFormComponent); this.formBuilder!.insertFormItem(this.targetConnectionFormComponent, 2); this.connectionIsDataSource = false; @@ -266,7 +266,7 @@ export class PublishDatabaseDialog { label: constants.dataSourceRadioButtonLabel }).component(); - this.dataSourcesRadioButton.onDidClick(async () => { + this.dataSourcesRadioButton.onDidClick(() => { this.formBuilder!.removeFormItem(this.targetConnectionFormComponent); this.formBuilder!.insertFormItem(this.dataSourcesFormComponent, 2); this.connectionIsDataSource = true; @@ -423,7 +423,7 @@ export class PublishDatabaseDialog { this.profileSqlCmdVars = result.sqlCmdVariables; const data = this.convertSqlCmdVarsToTableFormat(this.getSqlCmdVariablesForPublish()); - (this.sqlCmdVariablesTable).updateProperties({ + await (this.sqlCmdVariablesTable).updateProperties({ data: data }); diff --git a/extensions/sql-database-projects/src/test/buildHelper.test.ts b/extensions/sql-database-projects/src/test/buildHelper.test.ts index e2aa6d5000..68cb70ab98 100644 --- a/extensions/sql-database-projects/src/test/buildHelper.test.ts +++ b/extensions/sql-database-projects/src/test/buildHelper.test.ts @@ -11,7 +11,7 @@ import { BuildHelper } from '../tools/buildHelper'; describe('BuildHelper: Build Helper tests', function (): void { - it('Should get correct build arguments', async function (): Promise { + it('Should get correct build arguments', function (): void { // update settings and validate const buildHelper = new BuildHelper(); const resultArg = buildHelper.constructBuildArguments('dummy\\project path\\more space in path', 'dummy\\dll path'); diff --git a/extensions/sql-database-projects/src/test/mainController.test.ts b/extensions/sql-database-projects/src/test/mainController.test.ts index c43d972c1b..92d7dc4ae7 100644 --- a/extensions/sql-database-projects/src/test/mainController.test.ts +++ b/extensions/sql-database-projects/src/test/mainController.test.ts @@ -25,7 +25,7 @@ describe('MainController: main controller operations', function (): void { await baselines.loadBaselines(); }); - beforeEach(async function (): Promise { + beforeEach(function (): void { testContext.apiWrapper.reset(); }); diff --git a/extensions/sql-database-projects/src/test/netCoreTool.test.ts b/extensions/sql-database-projects/src/test/netCoreTool.test.ts index eeba3a6f17..787a664cc8 100644 --- a/extensions/sql-database-projects/src/test/netCoreTool.test.ts +++ b/extensions/sql-database-projects/src/test/netCoreTool.test.ts @@ -29,7 +29,7 @@ describe.skip('NetCoreTool: Net core tests', function (): void { } }); - it('Should find right dotnet default paths', async function (): Promise { + it('Should find right dotnet default paths', function (): void { const netcoreTool = new NetCoreTool(); netcoreTool.findOrInstallNetCore(); diff --git a/extensions/sql-database-projects/src/test/projectController.test.ts b/extensions/sql-database-projects/src/test/projectController.test.ts index 9d688b7be2..b1c5721c60 100644 --- a/extensions/sql-database-projects/src/test/projectController.test.ts +++ b/extensions/sql-database-projects/src/test/projectController.test.ts @@ -46,7 +46,7 @@ const mockConnectionProfile: azdata.IConnectionProfile = { options: undefined as any }; -beforeEach(async function (): Promise { +beforeEach(function (): void { testContext = createContext(); }); @@ -247,26 +247,26 @@ describe('ProjectsController: project controller operations', function (): void let publishDialog = TypeMoq.Mock.ofType(PublishDatabaseDialog, undefined, undefined, new ApiWrapper(), proj); publishDialog.callBase = true; - publishDialog.setup(x => x.getConnectionUri()).returns(async () => 'fake|connection|uri'); + publishDialog.setup(x => x.getConnectionUri()).returns(() => Promise.resolve('fake|connection|uri')); let projController = TypeMoq.Mock.ofType(ProjectsController); projController.callBase = true; projController.setup(x => x.getPublishDialog(TypeMoq.It.isAny())).returns(() => publishDialog.object); - projController.setup(x => x.executionCallback(TypeMoq.It.isAny(), TypeMoq.It.is((_): _ is IPublishSettings => true))).returns(async () => { + projController.setup(x => x.executionCallback(TypeMoq.It.isAny(), TypeMoq.It.is((_): _ is IPublishSettings => true))).returns(() => { holler = publishHoller; - return undefined; + return Promise.resolve(undefined); }); - projController.setup(x => x.readPublishProfile(TypeMoq.It.isAny())).returns(async () => { + projController.setup(x => x.readPublishProfile(TypeMoq.It.isAny())).returns(() => { holler = profileHoller; - return { - databaseName: '', - sqlCmdVariables: {} - }; + return Promise.resolve({ + databaseName: '', + sqlCmdVariables: {} + }); }); - projController.setup(x => x.executionCallback(TypeMoq.It.isAny(), TypeMoq.It.is((_): _ is IGenerateScriptSettings => true))).returns(async () => { + projController.setup(x => x.executionCallback(TypeMoq.It.isAny(), TypeMoq.It.is((_): _ is IGenerateScriptSettings => true))).returns(() => { holler = generateHoller; - return undefined; + return Promise.resolve(undefined); }); let dialog = await projController.object.publishProject(proj); diff --git a/extensions/sql-database-projects/src/test/projectTree.test.ts b/extensions/sql-database-projects/src/test/projectTree.test.ts index ca4c64e32d..b2ebe6c1e8 100644 --- a/extensions/sql-database-projects/src/test/projectTree.test.ts +++ b/extensions/sql-database-projects/src/test/projectTree.test.ts @@ -14,7 +14,7 @@ import { ProjectRootTreeItem } from '../models/tree/projectTreeItem'; import { DatabaseProjectItemType } from '../common/constants'; describe.skip('Project Tree tests', function (): void { - it('Should correctly order tree nodes by type, then by name', async function (): Promise { + it('Should correctly order tree nodes by type, then by name', function (): void { const root = os.platform() === 'win32' ? 'Z:\\' : '/'; const parent = new ProjectRootTreeItem(new Project(vscode.Uri.file(`${root}Fake.sqlproj`).fsPath)); @@ -46,7 +46,7 @@ describe.skip('Project Tree tests', function (): void { should(inputNodes.map(n => n.uri.path)).deepEqual(expectedNodes.map(n => n.uri.path)); }); - it('Should build tree from Project file correctly', async function (): Promise { + it('Should build tree from Project file correctly', function (): void { const root = os.platform() === 'win32' ? 'Z:\\' : '/'; const proj = new Project(vscode.Uri.file(`${root}TestProj.sqlproj`).fsPath); @@ -94,7 +94,7 @@ describe.skip('Project Tree tests', function (): void { DatabaseProjectItemType.file]); }); - it('Should be able to parse windows relative path as platform safe path', async function (): Promise { + it('Should be able to parse windows relative path as platform safe path', function (): void { const root = os.platform() === 'win32' ? 'Z:\\' : '/'; const proj = new Project(vscode.Uri.file(`${root}TestProj.sqlproj`).fsPath); diff --git a/extensions/sql-database-projects/src/test/publishDatabaseDialog.test.ts b/extensions/sql-database-projects/src/test/publishDatabaseDialog.test.ts index f08b2cbac5..0eabb4b3d4 100644 --- a/extensions/sql-database-projects/src/test/publishDatabaseDialog.test.ts +++ b/extensions/sql-database-projects/src/test/publishDatabaseDialog.test.ts @@ -28,7 +28,7 @@ describe.skip('Publish Database Dialog', () => { await baselines.loadBaselines(); }); - beforeEach(async function (): Promise { + beforeEach(function (): void { testContext = createContext(); }); @@ -58,7 +58,7 @@ describe.skip('Publish Database Dialog', () => { it('Should include all info in publish profile', async function (): Promise { const proj = await testUtils.createTestProject(baselines.openProjectFileBaseline); const dialog = TypeMoq.Mock.ofType(PublishDatabaseDialog, undefined, undefined, testContext.apiWrapper.object, proj); - dialog.setup(x => x.getConnectionUri()).returns(async () => { return 'Mock|Connection|Uri'; }); + dialog.setup(x => x.getConnectionUri()).returns(() => { return Promise.resolve('Mock|Connection|Uri'); }); dialog.setup(x => x.getTargetDatabaseName()).returns(() => 'MockDatabaseName'); dialog.callBase = true; @@ -74,7 +74,7 @@ describe.skip('Publish Database Dialog', () => { } }; - dialog.object.publish = async (_, prof) => { profile = prof; }; + dialog.object.publish = (_, prof) => { profile = prof; }; await dialog.object.publishClick(); should(profile).deepEqual(expectedPublish); @@ -88,7 +88,7 @@ describe.skip('Publish Database Dialog', () => { } }; - dialog.object.generateScript = async (_, prof) => { profile = prof; }; + dialog.object.generateScript = (_, prof) => { profile = prof; }; await dialog.object.generateScriptClick(); should(profile).deepEqual(expectedGenScript);