This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 787
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow
MockedResponse
results to be returned from a function
The `result` property of a `MockedResponse` is currently restricted to being a pre-configured fixed value. Allowing results to be calculated/returned from a function instead of being pre-configured, opens up new test verification paths, that can be useful when using `MockedProvider`. This commit adjusts `MockedResponse`’s `result` such that if a function is set for its value, that function will be fired and its result will be passed to the Observable matching the incoming mocked `request`. Fixes apollographql/apollo-feature-requests#84.
- Loading branch information
Showing
3 changed files
with
83 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters