MCPcopy Create free account
hub / github.com/angular/components / getHarnessOrNull

Function getHarnessOrNull

src/cdk/testing/harness-environment.ts:247–249  ·  view source on GitHub ↗

* Searches for an instance of the component corresponding to the given harness type under the * `HarnessEnvironment`'s root element, and returns a `ComponentHarness` for that instance. If * multiple matching components are found, a harness for the first one is returned. If no matching * com

(query: HarnessQuery<T>)

Source from the content-addressed store, hash-verified

245 * @return An instance of the given harness type (or null if not found).
246 */
247 getHarnessOrNull<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T | null> {
248 return this.locatorForOptional(query)();
249 }
250
251 /**
252 * Searches for an instance of the component corresponding to the given harness type and index

Callers

nothing calls this directly

Calls 1

locatorForOptionalMethod · 0.80

Tested by

no test coverage detected