There were a couple of other things that meant he didn't do great initially, but the infection was the main one and was the reason we were in hospital so long.
Just before/at the start of labour is the best time to be tested because the infection can come and go, so if you're tested too early and it comes back ok you still have time for the infection to develop without you knowing. I was very lucky that my hospital trust are part of a national trial to offer the test to all women with immediate results as they can process the swab on-site - in other areas the standard practice is to only offer the test if you're deemed at high risk of infection (which I wasn't), and it's done any time from 37 weeks (full term) as the swab has to be sent away, and they want the results back before you're likely to go into labour so they know whether to give antibiotics.
I was aware of group b strep before pregnancy so specifically asked about testing at my midwife appointments, but hadn't looked at the statistics about outcomes until he was a couple of months old and it really upset me. I contacted the research team in my area and wrote a case study for inclusion in a conference about the trial in case it helps sway the NHS into making testing available to all pregnant women, and in the meantime am trying to spread the word a bit and encourage people to discuss it with their midwife and accept the test if it's offered because it can make such a difference.
Sorry if that all sounds doom and gloom - I just wanted to share my experience so you can all find out more if you weren't aware of it - and if baby does get the infection, neonatal units are absolutely incredible and will do everything in their power to keep baby safe and to get them back to you ASAP