your concerns are well grounded. When a baby is born and there is evidence of drug use, the urine and first stool (meconium) is test for drugs of abuse. If this testing returns positive it may lead to a significant hassle for you. The idea, really, for all of us that do this on a daily basis - 'is this baby going to be taken to a suitable environment?' As you can imagine, most of use think that an environment where drugs are being used is not. You need to stop smoking. Rearrange your priorities and put your baby first. I know this will not be easy, but you have to do it!
babies are tested when reasonable suspicion exists. Not all babies are tested. If you have had a positive drug screen during your pregnancy, there is a good chance your baby will be tested.