Ideally, you should undergo STD testing before getting pregnant, but herpes simplex is a virus that stays in your body permanently and can strike again at any time. There is little risk to your unborn baby while it is safely tucked away in your uterus, which its amniotic sack intact. Unless you are infected for the first time during your first trimester, in which case genital herpes can cause serious birth defects. Genital herpes can be dangerous to babies if their mother is experiencing a primary outbreak during childbirth, because the infection can be passed on.
Newborn herpes is extremely uncommon, and that is just as well, because it can be life threatening. If you were infected with genital herpes before you got pregnant, and have no outbreak when you go into labor, you are not deemed to be at risk by most experts, and you will be able to have a normal vaginal birth.
If you were infected for the first time before the start of your third trimester, and have received treatment that was successful, herpes will be unlikely to affect your baby too. However, if you have an active outbreak around your due date, or if you had a primary outbreak of genital herpes during your third trimester, most healthcare providers will recommend a cesarean section to prevent transmission to your baby. You can discuss the details during prenatal appointments, and ask questions. One thing that is worth noting is that it is not just genital herpes that is dangerous for your baby. If you have a newborn or are about to give birth, and have a cold sore on your mouth, it is absolutely essential to protect your baby by covering your mouth and avoiding contact between your cold sore and your baby's body.