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

Function expectQuickInfo

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

Source from the content-addressed store, hash-verified

1409 });
1410
1411 function expectQuickInfo({
1412 templateOverride,
1413 expectedSpanText,
1414 expectedDisplayString,
1415 }: {
1416 templateOverride: string;
1417 expectedSpanText: string;
1418 expectedDisplayString: string;
1419 }): ts.QuickInfo {
1420 const text = templateOverride.replace('¦', '');
1421 const template = project.openFile('app.html');
1422 template.contents = text;
1423 env.expectNoSourceDiagnostics();
1424
1425 template.moveCursorToText(templateOverride);
1426 const quickInfo = template.getQuickInfoAtPosition();
1427 expect(quickInfo).toBeTruthy();
1428 const {textSpan, displayParts} = quickInfo!;
1429 expect(text.substring(textSpan.start, textSpan.start + textSpan.length)).toEqual(
1430 expectedSpanText,
1431 );
1432 expect(toText(displayParts)).toEqual(expectedDisplayString);
1433 return quickInfo!;
1434 }
1435});
1436
1437function 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