MCPcopy
hub / github.com/angular/components / getHarnessAtIndex

Function getHarnessAtIndex

src/cdk/testing/component-harness.ts:529–534  ·  view source on GitHub ↗

* Gets a matching harness for the given query and index within the current harness's content. * @param query The harness query to search for. * @param index The zero-indexed offset of the component to find. * @returns The first harness matching the given query. * @throws If no matching h

(
    query: HarnessQuery<T>,
    index: number,
  )

Source from the content-addressed store, hash-verified

527 * @throws If no matching harness is found.
528 */
529 async getHarnessAtIndex<T extends ComponentHarness>(
530 query: HarnessQuery<T>,
531 index: number,
532 ): Promise<T> {
533 return (await this.getRootHarnessLoader()).getHarnessAtIndex(query, index);
534 }
535
536 /**
537 * Gets all matching harnesses for the given query within the current harness's content.

Callers

nothing calls this directly

Calls 2

getHarnessAtIndexMethod · 0.80
getRootHarnessLoaderMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…