-
-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(routing): add option to disable stubs and use RouterTestingModule #188
Conversation
2e52be5
to
7ad0d86
Compare
Before merging and releasing, should we create a beta/RC release to test if this PR really fixes the original issue? |
@dirkluijk Yes, we can test it with the reproduction repo. It's in the original issue. |
useFactory: () => | ||
new ActivatedRouteStub({ | ||
// this prevents the events property to be undefined | ||
router.castToWritable().events = EMPTY; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if someone needs to test the router events? They might register a subscription in the component and want to test it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, for now I assume that you should provide your own mock provider if you want to configure mocks more advanced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just do the following?
options.mockProvider(Router, {
events = new Subject();
emitRouterEvent(e) {
this.events.next(e)
}
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all right, will do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, can you check again?
19ede7e
to
8c4a624
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks. Approved, just check the CI.
Closes #179.
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?
The
ActivatedRouteStub
does not work well withRouterTestingModule
andLocation
.Issue Number: 179
What is the new behavior?
This PR provides a feature toggle. Example in README.
Does this PR introduce a breaking change?
Other information