How to trigger ROOT_EFFECTS_INIT event in ngrx unit test #3626
-
|
I have two exactly the same code to detect whether the language initialization method is called when the project initializes But It looks like ROOT_EFFECTS_INIT cannot be called in unit tests |
Beta Was this translation helpful? Give feedback.
Answered by
timdeschryver
Oct 21, 2022
Replies: 1 comment 1 reply
-
|
That's because For example with actions$ = of({type: ROOT_EFFECTS_INIT});Or, you can use |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
tirelyl
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


That's because
ROOT_EFFECTS_INITis just a string, you need to create an action of it so that the effect picks it up.For example with
Or, you can use
rootEffectsInitwhich is the action withROOT_EFFECTS_INITas its type.