Final ADS-side hookup for sqlcmd vars (#10815)

* Adding reading SqlCmdVars from project file

* organized apiWrapper, added calls

* Adding test to confirm deployment/script gen profiles with sqlcmd vars
This commit is contained in:
Benjin Dubishar
2020-06-12 19:49:28 -07:00
committed by GitHub
parent 26a00696d4
commit ddb210e971
9 changed files with 212 additions and 76 deletions

View File

@@ -31,12 +31,19 @@ describe('Project: sqlproj content operations', function (): void {
const project: Project = new Project(projFilePath);
await project.readProjFile();
// Files and folders
should(project.files.filter(f => f.type === EntryType.File).length).equal(4);
should(project.files.filter(f => f.type === EntryType.Folder).length).equal(5);
should(project.files.find(f => f.type === EntryType.Folder && f.relativePath === 'Views\\User')).not.equal(undefined); // mixed ItemGroup folder
should(project.files.find(f => f.type === EntryType.File && f.relativePath === 'Views\\User\\Profile.sql')).not.equal(undefined); // mixed ItemGroup file
// SqlCmdVariables
should(Object.keys(project.sqlCmdVariables).length).equal(2);
should(project.sqlCmdVariables['ProdDatabaseName']).equal('MyProdDatabase');
should(project.sqlCmdVariables['BackupDatabaseName']).equal('MyBackupDatabase');
// Database references
should(project.databaseReferences.length).equal(1);
should(project.databaseReferences[0]).containEql(constants.master);
});