Deuteronomy 13:3

Thou shalt not hearken unto the words of that prophet, or that dreamer of dreams: for the LORD your God proveth you, to know whether ye love the LORD your God with all your heart and with all your soul.

Thou shall not hearken to the words of that prophet, or that dreamer of dreams,.... Even though he does give the sign, and work the wonder; for it might be reasonably concluded there must be fallacy in him, and that neither he nor his miraculous sign could come from God, who would never send a person to enable him to do signs and wonders, to persuade men to believe and act contrary to a former declaration of his mind and will; to break a plain law of his, as in Deuteronomy 5:7, this would be to contradict and deny himself; whatever therefore is contrary to a known law or established doctrine, either of law or Gospel, let it come from whom it will, or pretend to be confirmed by miracles, is not to be received; see Galatians 1:8,

for the LORD your God proveth you, whether you love the Lord your God with all your heart, and with all your soul; for should they be prevailed upon by such a prophet to hearken to his doctrine, and embrace it, and act according to it, it would be a plain case that they did not cordially love the Lord, since they could so easily, and by such pretences, be drawn aside from the true worship of him, and serve other gods; on the other hand, it would be a proof of their sincere affection for God, and of their close and strict attachment to him, that notwithstanding such specious pretences made, and such miracles wrought, yet abode by him and his worship, and could not be wrought upon to forsake him and follow other gods and serve them; see 1 Corinthians 11:19.