fix: custom matchers are not available when using createHttpFactory()#736
Merged
NetanelBasal merged 1 commit intongneat:masterfrom Nov 2, 2025
Merged
fix: custom matchers are not available when using createHttpFactory()#736NetanelBasal merged 1 commit intongneat:masterfrom
NetanelBasal merged 1 commit intongneat:masterfrom
Conversation
|
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Custom matchers are not available when using
createHttpFactory().It may have been a deliberate decision to add custom matchers only to DOM-related contexts ( component, directive, host or pipe), but:
createServiceFactory(), which does not necessary imply using components or DOMSome matchers are not necessarily DOM-only, and could be used in more general contexts, for example
toHaveProperty(). Also,is definitely much better developer experience than:
And better DX is what Spectator is all about.
So, for consistency, it would be nice to have custom matchers available regardless of the factory being used, which includes tests using
createHttpFactory. Which this Pull Request is attempting to solve.PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
TypeError: expect(...).toHaveProperty is not a functionin tests usingcreateHttpFactory. The error doesn't occur in tests using other factory functions (e.g.,createServiceFactory).Issue Number: N/A
What is the new behavior?
Custom matchers are available in tests using
createHttpFactory.Does this PR introduce a breaking change?
Other information