resend previous PR with test fixes (#19912)

* Revert "Revert "use reliable way to detect createtable statements (#19897)" (#19906)"

This reverts commit c211fb981c.

* fix tests

* fix test cases
This commit is contained in:
Alan Ren
2022-07-02 11:25:09 -07:00
committed by GitHub
parent 60026a39f9
commit 416e607f32
11 changed files with 80 additions and 19 deletions

View File

@@ -6,6 +6,7 @@
import * as path from 'path';
import * as os from 'os';
import * as constants from '../common/constants';
import * as templates from '../templates/templates';
import { promises as fs } from 'fs';
import should = require('should');
@@ -30,6 +31,10 @@ export async function shouldThrowSpecificError(block: Function, expectedMessage:
export async function createTestSqlProjFile(contents: string, folderPath?: string): Promise<string> {
folderPath = folderPath ?? path.join(await generateTestFolderPath(), 'TestProject');
const macroDict: Record<string, string> = {
'PROJECT_DSP': constants.defaultDSP
};
contents = templates.macroExpansion(contents, macroDict);
return await createTestFile(contents, 'TestProject.sqlproj', folderPath);
}