marijuana while pregnant

I am 36 weeks and just recently smoked, I am an almost everyday smoker because it helped me sleep and have an actual appetite. I will be giving birth in Pennsylvania and I've read in so many places they test the baby for it and if it comes back positive cps will be involved. I'm not here asking to be bashed, I'm just asking what I should expect at the hospital when I give birth.. my doctor doesn't know I smoke and I have never gave them a reason to suspect that I do, any other ganja moms that smoked while pregnant and they got to keep their baby? Also, what tests do they run on baby?