Test on whom?
Test on an adult needs only an oral swab or a blood sample.
If you are talking about testing the fetus, that would require amniotic fluid sampling and would be unethical to put the fetus at risk for a paternity test. It is possible that in the near future, testing fetal dna
in maternal blood would make if feasible to test the fetus, without putting the fetus at risk. There no law against these.