Pregnancy test

I’m just wondering if a pregnancy test can be done before two weeks? I’ve heard you’re suppose to wait 2 weeks but will it still come up before the 2 weeks is up? Sorry if the question doesn’t make much sense lol hopefully somebody will understand 😌