The 21-year-old singer plays the snippet at a UK radio show, reported Aceshowbiz.
"Saying that you love that I got hazel eyes/ And honestly, I won't catch up on sleep tonight/ I've been looking at London lights and missing you," she sang.
Trainor revealed last week that the 20-year-old singer wrote a song with her. She was left impressed by Styles' writing skills.