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

Function verifySpyCalls

packages/forms/test/reactive_integration_spec.ts:4717–4726  ·  view source on GitHub ↗
(spy: any, expectedContext: any, expectedCallCount?: number)

Source from the content-addressed store, hash-verified

4715
4716 // Verifies whether spy calls match expectations.
4717 function verifySpyCalls(spy: any, expectedContext: any, expectedCallCount?: number) {
4718 if (expectedContext === SHOULD_NOT_BE_CALLED) {
4719 expect(spy).not.toHaveBeenCalled();
4720 } else {
4721 expect(spy).toHaveBeenCalledWith(expectedContext);
4722 if (expectedCallCount !== undefined) {
4723 expect(spy.calls.count()).toBe(expectedCallCount);
4724 }
4725 }
4726 }
4727
4728 // Verify whether all spies attached to a given control match expectations.
4729 function verifySpies(control: AbstractControl, expected: any = {}) {

Callers 1

verifySpiesFunction · 0.85

Calls 1

countMethod · 0.65

Tested by

no test coverage detected