Refactor tests so its easy to edit and reason about them

This commit is contained in:
Sheetal Nandi
2019-07-03 12:15:24 -07:00
parent f7ea0bab60
commit b5737fc535
3 changed files with 835 additions and 494 deletions
+2 -2
View File
@@ -196,8 +196,8 @@ interface Array<T> {}`
}
}
export function checkWatchedFiles(host: TestServerHost, expectedFiles: string[]) {
checkMapKeys("watchedFiles", host.watchedFiles, expectedFiles);
export function checkWatchedFiles(host: TestServerHost, expectedFiles: string[], additionalInfo?: string) {
checkMapKeys(`watchedFiles:: ${additionalInfo || ""}::`, host.watchedFiles, expectedFiles);
}
export function checkWatchedFilesDetailed(host: TestServerHost, expectedFiles: ReadonlyMap<number>): void;
+2 -2
View File
@@ -488,8 +488,8 @@ namespace ts.projectSystem {
checkArray("Open files", arrayFrom(projectService.openFiles.keys(), path => projectService.getScriptInfoForPath(path as Path)!.fileName), expectedFiles.map(file => file.path));
}
export function checkScriptInfos(projectService: server.ProjectService, expectedFiles: ReadonlyArray<string>) {
checkArray("ScriptInfos files", arrayFrom(projectService.filenameToScriptInfo.values(), info => info.fileName), expectedFiles);
export function checkScriptInfos(projectService: server.ProjectService, expectedFiles: ReadonlyArray<string>, additionInfo?: string) {
checkArray(`ScriptInfos files: ${additionInfo || ""}`, arrayFrom(projectService.filenameToScriptInfo.values(), info => info.fileName), expectedFiles);
}
export function protocolLocationFromSubstring(str: string, substring: string): protocol.Location {
File diff suppressed because it is too large Load Diff