Skip to content

Commit f6e2429

Browse files
authored
Merge pull request #10788 from Microsoft/useBaselinesForQuickInfoTests
Use baselines for quick info tests to ease updates
2 parents ccca525 + 76fe6e4 commit f6e2429

File tree

64 files changed

+34840
-1998
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+34840
-1998
lines changed

src/harness/fourslash.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,6 +1294,22 @@ namespace FourSlash {
12941294
});
12951295
}
12961296

1297+
public baselineQuickInfo() {
1298+
let baselineFile = this.testData.globalOptions[metadataOptionNames.baselineFile];
1299+
if (!baselineFile) {
1300+
baselineFile = ts.getBaseFileName(this.activeFile.fileName).replace(".ts", ".baseline");
1301+
}
1302+
1303+
Harness.Baseline.runBaseline(
1304+
baselineFile,
1305+
() => stringify(
1306+
this.testData.markers.map(marker => ({
1307+
marker,
1308+
quickInfo: this.languageService.getQuickInfoAtPosition(marker.fileName, marker.position)
1309+
}))
1310+
));
1311+
}
1312+
12971313
public printBreakpointLocation(pos: number) {
12981314
Harness.IO.log("\n**Pos: " + pos + " " + this.spanInfoToString(pos, this.getBreakpointStatementLocation(pos), " "));
12991315
}
@@ -3103,6 +3119,10 @@ namespace FourSlashInterface {
31033119
this.state.baselineGetEmitOutput();
31043120
}
31053121

3122+
public baselineQuickInfo() {
3123+
this.state.baselineQuickInfo();
3124+
}
3125+
31063126
public nameOrDottedNameSpanTextIs(text: string) {
31073127
this.state.verifyCurrentNameOrDottedNameSpanText(text);
31083128
}

0 commit comments

Comments
 (0)