MCPcopy Create free account
hub / github.com/angular/angular / expectQuickInfo

Function expectQuickInfo

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

Source from the content-addressed store, hash-verified

1454 });
1455
1456 function expectQuickInfo({
1457 templateOverride,
1458 expectedSpanText,
1459 expectedDisplayString,
1460 }: {
1461 templateOverride: string;
1462 expectedSpanText: string;
1463 expectedDisplayString: string;
1464 }): ts.QuickInfo {
1465 const text = templateOverride.replace('¦', '');
1466 const template = project.openFile('app.html');
1467 template.contents = text;
1468 env.expectNoSourceDiagnostics();
1469
1470 template.moveCursorToText(templateOverride);
1471 const quickInfo = template.getQuickInfoAtPosition();
1472 expect(quickInfo).toBeTruthy();
1473 const {textSpan, displayParts} = quickInfo!;
1474 expect(text.substring(textSpan.start, textSpan.start + textSpan.length)).toEqual(
1475 expectedSpanText,
1476 );
1477 expect(toText(displayParts)).toEqual(expectedDisplayString);
1478 return quickInfo!;
1479 }
1480});
1481
1482function 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