Get mix task output so far for tests

Sorry for the confusion. I did misread the question. Seems Mix.Shell.Process is exactly what you need:

This is mainly useful in tests, allowing us to assert if given messages were received or not instead of performing checks on some captured IO. Since we need to guarantee a clean slate between tests, there is also a flush/1 function responsible for flushing all :mix_shell related messages from the process inbox.

It’s not Hex-specific at all.