There is no one best time to tell a friend who has fertility problems about a pregnancy. However, what is advisable is to tell her before she realises that you are hiding something from her and before she finds out about the pregnancy because it is already obvious or, even worse, from other people.
The recommendation is to do so when you are clear about what you are going to tell her and in a quiet and private place, avoiding details and advice and showing a lot of understanding.