Use baselines for quick info tests to ease updates

This commit is contained in:
Mohamed Hegazy
2016-09-08 12:55:58 -07:00
parent 7f84953347
commit 069c10ca83
62 changed files with 32612 additions and 1998 deletions

View File

@@ -1294,6 +1294,22 @@ namespace FourSlash {
});
}
public baselineQuickInfo() {
let baselineFile = this.testData.globalOptions[metadataOptionNames.baselineFile];
if (!baselineFile) {
baselineFile = ts.getBaseFileName(this.activeFile.fileName).replace(".ts", ".baseline");
}
Harness.Baseline.runBaseline(
baselineFile,
() => stringify(
this.testData.markers.map(marker => ({
marker: marker,
quickInfo: this.languageService.getQuickInfoAtPosition(marker.fileName, marker.position)
}))
));
}
public printBreakpointLocation(pos: number) {
Harness.IO.log("\n**Pos: " + pos + " " + this.spanInfoToString(pos, this.getBreakpointStatementLocation(pos), " "));
}
@@ -3103,6 +3119,10 @@ namespace FourSlashInterface {
this.state.baselineGetEmitOutput();
}
public baselineQuickInfo() {
this.state.baselineQuickInfo();
}
public nameOrDottedNameSpanTextIs(text: string) {
this.state.verifyCurrentNameOrDottedNameSpanText(text);
}