| 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 = {}) { |