Pregnancy test question!

How soon before my period is due can I take the pregnancy test