MCPcopy Index your code
hub / github.com/angular/angular / expectQuickInfo

Function expectQuickInfo

packages/language-service/test/quick_info_spec.ts:1269–1292  ·  view source on GitHub ↗
({
    templateOverride,
    expectedSpanText,
    expectedDisplayString,
  }: {
    templateOverride: string;
    expectedSpanText: string;
    expectedDisplayString: string;
  })

Source from the content-addressed store, hash-verified

1267 });
1268
1269 function expectQuickInfo({
1270 templateOverride,
1271 expectedSpanText,
1272 expectedDisplayString,
1273 }: {
1274 templateOverride: string;
1275 expectedSpanText: string;
1276 expectedDisplayString: string;
1277 }): ts.QuickInfo {
1278 const text = templateOverride.replace('¦', '');
1279 const template = project.openFile('app.html');
1280 template.contents = text;
1281 env.expectNoSourceDiagnostics();
1282
1283 template.moveCursorToText(templateOverride);
1284 const quickInfo = template.getQuickInfoAtPosition();
1285 expect(quickInfo).toBeTruthy();
1286 const {textSpan, displayParts} = quickInfo!;
1287 expect(text.substring(textSpan.start, textSpan.start + textSpan.length)).toEqual(
1288 expectedSpanText,
1289 );
1290 expect(toText(displayParts)).toEqual(expectedDisplayString);
1291 return quickInfo!;
1292 }
1293});
1294
1295function toText(displayParts?: ts.SymbolDisplayPart[]): string {

Callers 1

quick_info_spec.tsFile · 0.85

Calls 6

moveCursorToTextMethod · 0.80
toTextFunction · 0.70
replaceMethod · 0.45
openFileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…