Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:33:7

And ˹mention, O Muhammad˺, when We took from the prophets their covenant and from you and from Noah and Abraham and Moses and Jesus, the son of Mary; and We took from them a solemn covenant.  

And, mention, when We took a pledge from the prophets, at the point when they were brought forth from the loins of Adam, the size of atoms, and from you, and from Noah and Abraham and Moses and Jesus son of Mary, that they worship ˹only˺ God and call others to worship Him (the mention of the five ˹names˺ is an instance of supplementing the specific to the general). And We took from them a solemn pledge, a solid ˹one˺, that they fulfil what they have been charged with, and this was ˹effected˺ by ˹swearing˺ an oath to God, after which the pledge was consummated;
القرآن:٣٣:٧

وَإِذْ أَخَذْنَا مِنَ النَّبِيِّينَ مِيثَاقَهُمْ وَمِنْكَ وَمِنْ نُوحٍ وَإِبْرَاهِيمَ وَمُوسَىٰ وَعِيسَى ابْنِ مَرْيَمَ ۖ وَأَخَذْنَا مِنْهُمْ مِيثَاقًا غَلِيظًا  

{و} اذكر {إذ أخذنا من النبيين ميثاقهم} حين أخرجوا من صلب آدم كالذرّ جمع ذرة وهي أصغر النمل {ومنك ومن نوح وإبراهيم وموسى وعيسى ابن مريم} بأن يعبدوا الله ويدعوا إلى عبادته وذكر الخمسة من عطف الخاص على العام {وأخذنا منهم ميثاقا غليظا} شديدا بالوفاء بما حملوه وهو اليمين بالله تعالى ثم أخذ الميثاق.