Enable sql-database-projects tests with few fixes (#10610)

* Added 2tests related to import. Fixed a few issues. Enable sql-database-projects

* Addressed comment
This commit is contained in:
Sakshi Sharma
2020-05-30 09:05:55 -07:00
committed by GitHub
parent 7d31239e64
commit 84492049e8
5 changed files with 50 additions and 15 deletions

View File

@@ -79,7 +79,7 @@ export async function createDummyFileStructure(createList?: boolean, list?: stri
testFolderPath = testFolderPath ?? await generateTestFolderPath();
let filePath = path.join(testFolderPath, 'file1.sql');
await fs.open(filePath, 'w');
await fs.writeFile(filePath, '');
if (createList) {
list?.push(testFolderPath);
list?.push(filePath);
@@ -88,13 +88,14 @@ export async function createDummyFileStructure(createList?: boolean, list?: stri
for (let dirCount = 1; dirCount <= 2; dirCount++) {
let dirName = path.join(testFolderPath, `folder${dirCount}`);
await fs.mkdir(dirName, { recursive: true });
if (createList) {
list?.push(dirName);
}
for (let fileCount = 1; fileCount <= 5; fileCount++) {
let fileName = path.join(dirName, `file${fileCount}.sql`);
await fs.open(fileName, 'w');
await fs.writeFile(fileName, '');
if (createList) {
list?.push(fileName);
}
@@ -102,7 +103,8 @@ export async function createDummyFileStructure(createList?: boolean, list?: stri
}
filePath = path.join(testFolderPath, 'file2.txt');
await fs.open(filePath, 'w');
//await touchFile(filePath);
await fs.writeFile(filePath, '');
if (createList) {
list?.push(filePath);
}