-
-
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
MockStore selectors resulting in warning logs #2363
Labels
Comments
I can take this one. |
timdeschryver
added
Accepting PRs
community watch
Someone from the community is working this issue/PR
labels
Feb 23, 2020
@timdeschryver can you please give me the example of the test which produces that warning? |
@evgenyfedorenko the example tests log them, run
|
evgenyfedorenko
added a commit
to evgenyfedorenko/platform
that referenced
this issue
Mar 2, 2020
3 tasks
evgenyfedorenko
added a commit
to evgenyfedorenko/platform
that referenced
this issue
Mar 4, 2020
evgenyfedorenko
added a commit
to evgenyfedorenko/platform
that referenced
this issue
May 3, 2020
evgenyfedorenko
added a commit
to evgenyfedorenko/platform
that referenced
this issue
May 3, 2020
evgenyfedorenko
added a commit
to evgenyfedorenko/platform
that referenced
this issue
May 3, 2020
evgenyfedorenko
added a commit
to evgenyfedorenko/platform
that referenced
this issue
May 6, 2020
3 tasks
evgenyfedorenko
added a commit
to evgenyfedorenko/platform
that referenced
this issue
May 10, 2020
evgenyfedorenko
added a commit
to evgenyfedorenko/platform
that referenced
this issue
May 10, 2020
Closes ngrx#2363
BioPhoton
pushed a commit
to BioPhoton/platform
that referenced
this issue
Jun 5, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Minimal reproduction of the bug/regression with instructions:
Currently all the tests that use a mockstore with mocked selectors, will log the warning that the state does not exists.
This is normal because when we define a mocks store, we don't define the state object.
Expected behavior:
It should not be logged while running tests.
Versions of NgRx, Angular, Node, affected browser(s) and operating system(s):
Angular 9
NgRx 9-beta.1
Other information:
AFAIK, it isn't possible to detect when we run in a test environment.
But we could set a property on the state (
__ngrxMockEnvironment__
), and thecreateFeatureSelector
could use this property to check if it the warning has to logged or not.I would be willing to submit a PR to fix this issue
[ ] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No
The text was updated successfully, but these errors were encountered: