(Exodus 3:1, continued:) "And he came to Horeb, the mountain of God" (ibid.). Rabbi Simeon ben Yose ben Leqonya said: Moses' flock walked forty days without eating; it tasted nothing — just as Elijah, of blessed memory, did, [as it is said (in 1 Kings 19:8): "And he arose, and ate, and drank, and went in the strength of that food forty days and forty nights, unto Horeb the mountain of God."]
Moses' Flock Fasts Forty Days to Horeb Like Elijah
Midrash Tanchuma Buber, Shemot 12:2
ויבא אל הר האלהים חורבה (שם). אמר ר' שמעון בן יוסי בן לקוניא הלכה צאנו של משה ארבעים יום בלא אכילה לא טעמה כלום, כשם שעשה אליהו זכור לטוב, [שנאמר ויקם ויאכל וישתה וילך בכח האכילה ההיא ארבעים יום וארבעים לילה עד הר האלהים חורב (מ"א יט ח) ].