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

Function checkIsHarness

src/cdk/testing/tests/cross-environment-tests.ts:720–729  ·  view source on GitHub ↗
(
  result: ComponentHarness | TestElement,
  harnessType: ComponentHarnessConstructor<T>,
  finalCheck?: (harness: T) => Promise<unknown>,
)

Source from the content-addressed store, hash-verified

718}
719
720export async function checkIsHarness<T extends ComponentHarness>(
721 result: ComponentHarness | TestElement,
722 harnessType: ComponentHarnessConstructor<T>,
723 finalCheck?: (harness: T) => Promise<unknown>,
724) {
725 expect(result.constructor === harnessType).toBe(true);
726 if (finalCheck) {
727 await finalCheck(result as T);
728 }
729}
730
731async function expectRejection(fn: () => Promise<unknown>, expectedError: string | RegExp) {
732 let error = '<blank>';

Callers 1

crossEnvironmentSpecsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected