-
Hey, as state changes are crucial events in all mobile apps, they should be tested thoroughly. I tried to emulate state changes by changing the lifecycle manually, e.g.:
However, this does not work. I guess when destroy is called, in a real app the whole component tree is rebuild and with it a new context that is passed to your root component, controlling the lifecycle, state and instances. The way the component tree is rebuild is different per platform? The way the lifecycle is controlled, state and instances are persisted. This seems to be hard to emulate in a shared module. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hello! Do you mean testing component recreation? Basically, you should create a new instance of |
Beta Was this translation helpful? Give feedback.
-
I didn't create an |
Beta Was this translation helpful? Give feedback.
Hello! Do you mean testing component recreation? Basically, you should create a new instance of
DefaultComponentContext
and therefore a new instance of your component. There are some sample tests.