Pregnancy test when?

I had spotting 4 days before AF. AF never showed but the spotting did. Went and took urine test at doctor yesterday came up negative . She said I️t might’ve been to early to pick up. I believe my spotting was implantation bleeding. How soon after implantation can you test for pregnancy?