No, the actress who played Jane, Gina Rodriguez, was not pregnant in real life when she portrayed the character.
Rodriguez herself stated that she wasn't pregnant and didn't even have a partner at the time she played Jane. She has shared that the role taught her a lot and she is now preparing to face many of the same issues her character dealt with.