TestScope
Creates a TestScope.
It ensures that all the test module machinery is properly initialized.
If context doesn't provide a TestCoroutineScheduler for orchestrating the virtual time used for delay-skipping, a new one is created, unless either
a TestDispatcher is provided, in which case TestDispatcher.scheduler is used;
at the moment of the creation of the scope, Dispatchers.Main is delegated to a TestDispatcher, in which case its TestCoroutineScheduler is used.
If context doesn't have a TestDispatcher, a StandardTestDispatcher is created.
A CoroutineExceptionHandler is created that makes TestCoroutineScope.cleanupTestCoroutines throw if there were any uncaught exceptions, or forwards the exceptions further in a platform-specific manner if the cleanup was already performed when an exception happened. Passing a CoroutineExceptionHandler is illegal, unless it's an UncaughtExceptionCaptor, in which case the behavior is preserved for the time being for backward compatibility. If you need to have a specific CoroutineExceptionHandler, please pass it to launch on an already-created TestCoroutineScope and share your use case at our issue tracker.
If context provides a Job, that job is used as a parent for the new scope.
Throws
if context has an CoroutineExceptionHandler that is not an UncaughtExceptionCaptor.