Irregular period bfp

For those of you that had irregular periods but ended up pregnant how did u know when to test ? And when did u test