It is simple.
Instead of exiting, orionExitFunction is called.
The contextBroker does an exit inside its orionExitFunction while unitTest does not.