No, I think you would have to wait until after the baby is born to get a DNA test. Until then try to be civil with your ex to prevent any type of drama once the baby is born.
I'm 28 and recently moved on, now my ex says she is pregnant with my child. Is there any way I can find out if the baby is mine before it is born?
Yes it's possible but there is a possibility of a miscarriage.