If your mini fridge got unplugged by accident and mold grew inside, it is not safe to drink the beer that was inside the fridge. Mold can produce harmful substances and toxins that can contaminate the food and beverages it comes into contact with. Ingesting these toxins can lead to health problems.
Additionally, mold can spread quickly and contaminate the entire contents of the fridge, even if it's not visible on the beer cans themselves. It's best not to take any chances with consuming potentially contaminated food or beverages.
In this situation, it's advisable to dispose of all the cans of beer that were inside the fridge. Make sure to thoroughly clean and disinfect the mini fridge before using it again to prevent further mold growth and to ensure the safety of any future contents you store inside.