Skip to content

Suiteopensavvy.prepared.suitelaunchInBackground

launchInBackground


fun TestDsl.launchInBackground(context: CoroutineContext = EmptyCoroutineContext, start: CoroutineStart = CoroutineStart.DEFAULT, block: suspend CoroutineScope.() -> Unit): Job

Starts a task in the backgroundScope scope. The test will not wait for this task before finishing.

This is useful to start background services which are not part of the system-under-test, yet are expected to be running by the system-under-test.

By default, tasks started are run sequentially. To execute tasks in parallel, explicitly use a CoroutineDispatcher.

The task will respect the controlled time.

See also