(Gen. 47:30:) "And I will lie down with my fathers." Jacob said to Joseph: If you do for me as I tell you, well and good; but if not, my soul shall depart from me. He said to him: I will do so for you. He said to him: "Swear to me"—(Gen. 47:31:) "and he swore to him." When he had passed away, what is written? (Gen. 50:12:) "And his sons did for him [thus], just as he had commanded them." The Holy One, blessed be He, said: In this world death does not let a person rejoice, but in the world to come, (Isa. 25:8:) "He will swallow up death forever," and so forth. When death is removed, what is written? (Isa. 65:19:) "And I will rejoice in Jerusalem and be glad in My people, and there shall no longer be heard in her the sound of weeping or the sound of crying out."
Jacob's Oath and the Swallowing of Death in the World to Come
Midrash Tanchuma Buber, Vayechi 7:1
ושכבתי עם אבותי. אמר יעקב ליוסף אם אתה עושה לי כמו שאני אור לך הרי יפה, ואם לאו נפשי יוצאה ממני, אמר לו כך אני עושה לך, אמר לו השבע וישבע לו, כיון שנסתלק מה כתיב, ויעשו בניו לו [כן] כאשר צום (בראשית נ יב), אמר הקב"ה בעולם הזה אין המות מניח לאדם שישמח, אבל לעולם הא בלע המות לנצח וגו' (ישעיה כה ח), כיון שהמות מסתלק מה כתיב וגלתי בירושלים וששתי בעמי ולא ישמע בה עוד קול בכי וקול (צעקה) [זעקה] (שם סה יט).