To mock and ridicule religion and the religionists is one of the peculiarities of the infidels, polytheists and hypocrites. At one place in the holy Quran, Allah Most High says about the Hypocrites:
"And when they fall in with those who believe, they say, ‘We believe’; but when they go apart to their devils they declare: ‘Lo! We are with you; verily we did but mock.’ Allah (Himself) doth mock them, leaving them to wander blindly on in their contumacy" (II: 14-15).
Similarly, when the Prophet Noah + was preparing the boat, the infidels, while passing by him, used to poke fun at him which Allah Most High has described thus:-
“And he was building the ship, and every time that chieftains of his people passed by him, they made mock of him. He said: ‘Though ye make mock of us, yet we mock at you likewise for your mocking.’” (XI: 38)
Then what eventually became those mockers is not hidden from any one i.e. the whole community was drowned in divine scourge.
Similarly, when the Meccan infidels began to scorn the Holy Prophet and laugh at the religion brought by him and scorn at his sayings and actions, the One and Partnerless Allah, consoling him, said: -
"Messengers before thee, indeed, were mocked, but that (torture) whereat they mocked. surrounded those who scoffed at them". (XXI: 41)