How long after spotting can u take a pregnancy test?

Nicci
I had a very abnormal period just a lot of spotting and was wondering when to take a test