Fixing bug where templates may get mapped before loaded from their files (#10111)

* Fixing potential bad order of template loading and map construction

* Fixing bug where templates get mapped before loaded from file

* Parallelizing loading templates from file
This commit is contained in:
Benjin Dubishar
2020-04-22 17:01:19 -07:00
committed by GitHub
parent 8311c3985d
commit 52f33cc587
7 changed files with 134 additions and 64 deletions

View File

@@ -8,6 +8,23 @@ import * as os from 'os';
import * as constants from '../common/constants';
import { promises as fs } from 'fs';
import should = require('should');
import { AssertionError } from 'assert';
export function shouldThrowSpecificError(block: Function, expectedMessage: string) {
let succeeded = false;
try {
block();
succeeded = true;
}
catch (err) {
should(err.message).equal(expectedMessage);
}
if (succeeded) {
throw new AssertionError({ message: 'Operation succeeded, but expected failure with exception: "' + expectedMessage + '"' });
}
}
export async function createTestSqlProj(contents: string, folderPath?: string): Promise<string> {
return await createTestFile(contents, 'TestProject.sqlproj', folderPath);