Sixteen-year-old Minnesota high-schooler Juno MacGuff (Ellen Page) discovers she is pregnant by her friend and longtime admirer, Paulie Bleeker (Michael Cera). She initially considers an abortion. Going to a local clinic run by a women's group, she encounters a schoolmate outside who is holding a rather pathetic one-person pro-life vigil. Once inside, however, a variety of factors lead Juno to leave. She decides against abortion, and she decides to give the baby up for adoption. With the help of her friend Leah (Olivia Thirlby), Juno searches the ads in the Pennysaver and finds a couple she feels will provide a suitable home. She tells her father, Mac (J.K. Simmons), and stepmother, Bren (Allison Janney), who offer their support. With Mac, Juno meets the couple, Mark and Vanessa Loring (Jason Bateman and Jennifer Garner), in their expensive home and agrees to a closed adoption.
Juno visits Mark a few times, with whom she shares tastes in punk rock and horror films. Mark, who has set aside his rock band youth (now confined to memorabilia displayed in the one room of the house that Vanessa has designated for Mark's personal belongings), works at home composing commercial jingles. Juno and Leah happen to see Vanessa in a shopping mall being completely at ease with a child, and Juno encourages Vanessa to talk to her baby in the womb, where it kicks for her.
As the pregnancy progresses, Juno struggles with the emotions she feels for the baby's father, Paulie, who is clearly in love with Juno. Juno maintains an outwardly indifferent attitude toward Paulie, but when she learns he has asked another girl to the upcoming prom, she angrily confronts him. Paulie reminds Juno that it is at her request they remain distant and tells her that she broke his heart.
Not long before her baby is due, Juno is again visiting Mark when their interaction becomes emotional. Mark then tells her he will be leaving Vanessa. Juno is horrified by this revelation, with Mark asking Juno "How do you think of me?" Vanessa arrives home, and Mark tells her he does not feel ready to be a father and there are still things he wants to do first. Juno watches the Loring marriage fall apart, then drives away and breaks down in tears by the side of the road. Returning to the Lorings' home, she leaves a note and disappears as they answer the door.
After a heartfelt discussion with her father, Juno accepts that she loves Paulie. Juno then tells Paulie she loves him, and Paulie's actions make it clear her feelings are very much reciprocated. Not long after, Juno goes into labor and is rushed to the hospital, where she gives birth to a baby boy. She had deliberately not told Paulie because of his track meet. Seeing her missing from the stands, Paulie rushes to the hospital, finds Juno has given birth to their son, and comforts Juno as she cries. Vanessa comes to the hospital where she joyfully claims the newborn boy as a single adoptive mother. On the wall in the baby's new nursery, Vanessa has framed Juno's note, which reads: "Vanessa: If you're still in, I'm still in.Â âJuno." The film ends in the summertime with Juno and Paulie playing guitar and singing together, followed by a kiss.

Question: When did Mark tell his wife he was leaving her?
Answer: Shortly before Juno gave birth
Alternative answer: After telling Juno.