Speaking from experience I would say tell them. If they don't want to hire you on that basis, whilst seeming unfair to you, it's their perogative. And you can continue your search till you find someone who will employ you without being prejudiced nervous of your capabilities and commitment.
I got a new job knowing I was 6 weeks pregnant (unplanned!) and also thought: I could miscarry, I wouldn't tell anyone else at this stage,
if I do a good enough job they'll be fine, I'll only take 1 months
maternity leave etc etc bla bla. Well none of it really washed when I did tell them. They felt lied to, deceived and the relationship was
forever soured. In fact despite me working my arse off they tried
some sneaky, underhand ways to force me to resign. Ended in
lawsuit. Nightmare. Appreciate this is an extreme case but if I could
turn back the clock- I'd never do that again.
From a different perspective, I employ a nanny who became pregnant, naturally I was genuinely delighted for her but the pregnancy was very difficult. She had a huge amount of time off, was on bed rest for
a while, had restricted duties i.e couldnt pick up my toddler and sadly it ended up in a miscarriage. It was very sad and stressful.
It was also extremely hard and stressful for my dc as they had have emergency childcare, and also for me as I kept having to take unplanned time off work. It really dud impact in my family.
You can't predict how well a pregnancy us going to go, and I think a prospective employer needs to know do they can decide what's best for their family when they employ someone - especially when it's
looking after children.
Good luck with whatever you decide to do.