HttpTestingControllerlink
Controller to be injected into tests, that allows for mocking and flushing of requests.
方法
Search for requests that match the given parameter, without any expectations. | ||
参数
返回值 |
Expect that a single request has been made which matches the given URL, and return its mock. | ||||||||||||
|
params | Type: |
description | Type: 可选. 默认值是 |
返回值
Expect that a single request has been made which matches the given predicate function, and return its mock.
参数
matchFn | Type: |
description | Type: 可选. 默认值是 |
返回值
Expect that a single request has been made which matches the given condition, and return its mock.
参数
match | Type: |
description | Type: 可选. 默认值是 |
返回值
If no such request has been made, or more than one such request has been made, fail with an error message including the given request description, if any.
Expect that no requests have been made which match the given URL. | ||||||||||||
|
params | Type: |
description | Type: 可选. 默认值是 |
返回值
void
Expect that no requests have been made which match the given predicate function.
参数
matchFn | Type: |
description | Type: 可选. 默认值是 |
返回值
void
Expect that no requests have been made which match the given condition.
参数
match | Type: |
description | Type: 可选. 默认值是 |
返回值
void
If a matching request has been made, fail with an error message including the given request description, if any.
Verify that no unmatched requests are outstanding. | ||
参数
返回值
| ||
If any requests are outstanding, fail with an error message indicating which requests were not handled. If |