-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Rename getMockStore()
to createMockStore()
#3781
Comments
I like this suggestion 👍 |
Seems reasonable to me. As mentioned, we can deprecate the old name. If there is an automatic migration added we can remove it in v16. |
@markostanimirovic yes, PR is now up (co #3789 - hopefully I did everything right) Happy to do the schematic one as well (looks like that comes after the first part is merged?) Thanks all for the prompt responses. |
i think i see side-effects in my tests with before: is it possible that the EDIT: made the test output even worse. obviously im using this the wrong way. (btw im doing mockSelectors.push(...) in 2 tests and beforeEach mockSelectors = []) |
Which @ngrx/* package(s) are relevant/related to the feature request?
store
Information
I have fallen into the trap a couple of times of thinking that
getMockStore()
was an alias forTestBed.inject(MockStore)
. For the most part, it will serve a similar purpose, and it the name hints that it will get the mock store I need.However, it falls apart when you start to use things like
overrideSelector
asgetMockStore().overrideSelector()
will not function the same asTestBed.inject(MockStore).overrideSelector()
(as you may not get the same mock store used by your component).I would like to suggest that the function be renamed to
createMockStore()
to avoid confusion by making it clear that this will be creating a new mock store rather than getting an existing one (probably with a deprecation period forcreateMockStore()
.Describe any alternatives/workarounds you're currently using
No response
I would be willing to submit a PR to fix this issue
The text was updated successfully, but these errors were encountered: