Mix test --cover still passes if an unit test fails

i’m running unit tests and coverage with the following command

mix test --cover

the problem is that if an unit test fails and the coverage is above a threshold this command still passes. this means i need to run two commands on a build pipeline, first step is to check if the unit tests are passing and the second check is to see if the coverage is ok. is there some way i can do both in one command which is check the coverage and also make sure all the unit tests are passing.