Not everything can be unit tested. Figuring out what ide is doing and writing a plugin for what you actually want to do.. How to maintain plugin across ide updates...it's the start of rabbit hole and may not be worth it sometimes..
Break out of the IDE then -- run your unit tests from the command line. As an added bonus, it will be much easier to troubleshoot the headless CI builds too.