Smoking while pregnant

I am 6months pregnant and I still smoke. It helps wonders with the pregnancy but I know they do randomly drug testing at the hospital I will deliver at. Can anyone tell me when I should stop so I can pass the drug test and does anyone know what kind of drug test it will be. Like by pee blood etc