mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 09:35:37 -05:00
Tests for round tripping with SSDT projects (#10646)
* Test code for round tripping feature * Fixed tests. Edited updateImportedTargetsToProjFile method to push newly added import target to the list. * Added couple more tests * Addressed comment
This commit is contained in:
@@ -72,7 +72,7 @@ export class ProjectsController {
|
||||
this.projects.push(newProject);
|
||||
|
||||
// Update for round tripping as needed
|
||||
await newProject.updateProjectForRoundTrip();
|
||||
await this.updateProjectForRoundTrip(newProject);
|
||||
|
||||
// Read datasources.json (if present)
|
||||
const dataSourcesFilePath = path.join(path.dirname(projectFile.fsPath), constants.dataSourcesFileName);
|
||||
@@ -298,6 +298,17 @@ export class ProjectsController {
|
||||
return new DeployDatabaseDialog(this.apiWrapper, project);
|
||||
}
|
||||
|
||||
public async updateProjectForRoundTrip(project: Project) {
|
||||
if (project.importedTargets.includes(constants.NetCoreTargets)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const result = await this.apiWrapper.showWarningMessage(constants.updateProjectForRoundTrip, constants.yesString, constants.noString);
|
||||
if (result === constants.yesString) {
|
||||
await project.updateProjectForRoundTrip();
|
||||
}
|
||||
}
|
||||
|
||||
private static getProjectFromContext(context: Project | BaseProjectTreeItem) {
|
||||
if (context instanceof Project) {
|
||||
return context;
|
||||
|
||||
Reference in New Issue
Block a user