In order to control scheduling of tests, test setup must be separated from test running. This is because of how internal scheduling of React Native is restricted until bundle is loaded via BufferedRuntimeExecutor. This is the reason for executing tests by calling global function $$RunTests$$. This is not a pretty solution but it is hidden within testing infrastructure and users of our test infra are not exposed to this.
There is a new method exposed to JavaScript: flushMessageQueue. This will flush everything that is inside of message queue. This is the queue where tasks are queued whenever RuntimeScheduler enqueues something by calling runtimeExecutor_.
Summary: changelog: [internal]
In order to control scheduling of tests, test setup must be separated from test running. This is because of how internal scheduling of React Native is restricted until bundle is loaded via BufferedRuntimeExecutor. This is the reason for executing tests by calling global function
$$RunTests$$
. This is not a pretty solution but it is hidden within testing infrastructure and users of our test infra are not exposed to this.There is a new method exposed to JavaScript: flushMessageQueue. This will flush everything that is inside of message queue. This is the queue where tasks are queued whenever RuntimeScheduler enqueues something by calling
runtimeExecutor_
.Reviewed By: christophpurrer
Differential Revision: D65951894