mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-15 09:35:37 -05:00
Cleanup generated test files and folders for Sql DB projects (#20862)
* Cleanup generated test files and folders * Add await to fix tests
This commit is contained in:
@@ -31,6 +31,10 @@ describe('Add Database Reference Dialog', () => {
|
||||
sinon.restore();
|
||||
});
|
||||
|
||||
after(async function(): Promise<void> {
|
||||
await testUtils.deleteGeneratedTestFolder();
|
||||
});
|
||||
|
||||
it('Should open dialog successfully', async function (): Promise<void> {
|
||||
const project = await testUtils.createTestProject(baselines.newProjectFileBaseline);
|
||||
const dialog = new AddDatabaseReferenceDialog(project);
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
import * as should from 'should';
|
||||
import * as path from 'path';
|
||||
import * as os from 'os';
|
||||
import * as vscode from 'vscode';
|
||||
import * as baselines from '../baselines/baselines';
|
||||
import * as templates from '../../templates/templates';
|
||||
@@ -27,9 +26,13 @@ describe('Publish Database Dialog', () => {
|
||||
testContext = createContext();
|
||||
});
|
||||
|
||||
after(async function(): Promise<void> {
|
||||
await testUtils.deleteGeneratedTestFolder();
|
||||
});
|
||||
|
||||
it('Should open dialog successfully ', async function (): Promise<void> {
|
||||
const projController = new ProjectsController(testContext.outputChannel);
|
||||
const projFileDir = path.join(os.tmpdir(), `TestProject_${new Date().getTime()}`);
|
||||
const projFileDir = path.join(testUtils.generateBaseFolderName(), `TestProject_${new Date().getTime()}`);
|
||||
|
||||
const projFilePath = await projController.createNewProject({
|
||||
newProjName: 'TestProjectName',
|
||||
@@ -48,7 +51,7 @@ describe('Publish Database Dialog', () => {
|
||||
it('Should create default database name correctly ', async function (): Promise<void> {
|
||||
const projController = new ProjectsController(testContext.outputChannel);
|
||||
const projFolder = `TestProject_${new Date().getTime()}`;
|
||||
const projFileDir = path.join(os.tmpdir(), projFolder);
|
||||
const projFileDir = path.join(testUtils.generateBaseFolderName(), projFolder);
|
||||
|
||||
const projFilePath = await projController.createNewProject({
|
||||
newProjName: 'TestProjectName',
|
||||
|
||||
@@ -19,6 +19,10 @@ describe('Publish Database Options Dialog', () => {
|
||||
await baselines.loadBaselines();
|
||||
});
|
||||
|
||||
after(async function(): Promise<void> {
|
||||
await testUtils.deleteGeneratedTestFolder();
|
||||
});
|
||||
|
||||
it('Should open dialog successfully ', async function (): Promise<void> {
|
||||
const proj = new Project('');
|
||||
sinon.stub(proj, 'getProjectTargetVersion').returns('150');
|
||||
|
||||
@@ -21,6 +21,10 @@ describe('Update Project From Database Dialog', () => {
|
||||
sinon.restore();
|
||||
});
|
||||
|
||||
after(async function(): Promise<void> {
|
||||
await testUtils.deleteGeneratedTestFolder();
|
||||
});
|
||||
|
||||
it('Should populate endpoints correctly when no context passed', async function (): Promise<void> {
|
||||
const dialog = new UpdateProjectFromDatabaseDialog(undefined, undefined);
|
||||
await dialog.openDialog();
|
||||
|
||||
Reference in New Issue
Block a user