Pregnancy Test

What’s the earliest a test works? I’m panicking. I took a pill right after but I’m still scared. I should be getting my period this week but I know the pill can make it late. It was about two weeks ago. Can a test already show accurate results?