Re-use shared MiniTest detection logic.