Hopeful for rainbow baby 👶 🌈✨

How soon can I take a test, thank you to anyone who replies. I know it’s best to wait till AF is due.