What's the earliest you can accurately take a pregnancy test ?

So inpatient lol my period is due in 7 days and wondering what the earliest date I can test is