mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-16 17:22:29 -05:00
Allow edit of sqlproj in place and reload (#11980)
* edit sql proj file * bug fix * updating reload project method * adding test for reload * formatting
This commit is contained in:
@@ -246,6 +246,26 @@ describe('ProjectsController', function (): void {
|
||||
should(await exists(scriptEntry.fsUri.fsPath)).equal(true, 'script is supposed to still exist on disk');
|
||||
});
|
||||
|
||||
it('Should reload correctly after changing sqlproj file', async function (): Promise<void> {
|
||||
// create project
|
||||
const folderPath = await testUtils.generateTestFolderPath();
|
||||
const sqlProjPath = await testUtils.createTestSqlProjFile(baselines.newProjectFileBaseline, folderPath);
|
||||
const treeProvider = new SqlDatabaseProjectTreeViewProvider();
|
||||
const projController = new ProjectsController(treeProvider);
|
||||
const project = await projController.openProject(vscode.Uri.file(sqlProjPath));
|
||||
|
||||
// change the sql project file
|
||||
await fs.writeFile(sqlProjPath, baselines.newProjectFileWithScriptBaseline);
|
||||
should(project.files.length).equal(0);
|
||||
|
||||
// call reload project
|
||||
await projController.reloadProject(vscode.Uri.file(project.projectFilePath));
|
||||
should(project.files.length).equal(1);
|
||||
|
||||
// check that the new project is in the tree
|
||||
should(treeProvider.getChildren()[0].children.find(c => c.friendlyName === 'Script1.sql')).not.equal(undefined);
|
||||
});
|
||||
|
||||
it('Should be able to add pre deploy and post deploy script', async function (): Promise<void> {
|
||||
const preDeployScriptName = 'PreDeployScript1.sql';
|
||||
const postDeployScriptName = 'PostDeployScript1.sql';
|
||||
|
||||
Reference in New Issue
Block a user