Gestational diabetes test

Do you have to fast before the test? I have heard different answers. My nurse told me to eat a meal 2 hours before and drink the drink 1 hour before. Is it because I have a late afternoon appointment? Any help is appreciated! (I'm just curious and of course will ask my Dr if it is a real issue for me!)