First of all, in the Scripture, YHWH is a good and loving God; He created Adam and Eve in His image and blessed them to be fruitful, multiply, and have dominion over all His creations. God's thoughts for His children are not of evil but peace and hope (Jer 29:11).
God tests/tempts no one with evil (James 1: 13), much less people who please Him, like Enoch and Jabez. God had taken Enoch without testing nor tasting death, for he walked with God (pleased God- LXX, Heb 11:5), and Jabez, prayed for no evil and pain, God granted.
God wants all His people to love God wholeheartedly, as in the "Shema Israel" (Dt 6:4-5), even more than their sons and daughters (Mt 10:37).
God is All-Knowing. God sees our thoughts and hearts, and nothing is hidden from Him (Ps 139:1-4). He does not need to test to find out how we would respond. Instead, God's test is to make us reflect on our state of mind. As we all have weaknesses and stumble in that regard, that is our reality, and Abraham was no exception. So now, for Abraham, God chose to use a drastic measure, such as the command in the text, for God had called him to be the Father of the chosen people, Israel.
Unlike in the case of King David, who asked God to test his heart (Ps 26), for Abraham, God initiated the test. It was not to try his faith in God, much less to reward him.
Abraham's faith in God was that God had already acknowledged (Gen 15: 6). His faith grew and matured through his journey of faith and obedience: He left his tribal land, not knowing the destination to this point of his life. Along the way, Abraham witnessed how God protects Sarah and Abraham from Paraho of Egypt and King Abimelech - God regarded two powerful kings as expendable and about to destroy them. God repeatedly assured him of His promises; moreover, He made the covenant of "cut-split" as in Genesis ch. 15. Then, at last, just as God promised, Isaac's birth from Abraham and Sarah, who were old and was as good as dead.
The faith of Abraham grew and matured to where not spare but offered up Isaac with no hesitation: Abraham rose early in the morning and headed to the mount; Abraham said to his servants, "I and the boy" will go there, and "we" will return to you. Then, in response to the heartbreaking question -"Father, where is the sacrifice," he said, "God will provide for Himself." Then, without hesitation, he tied up and placed Isaac on the altar and raised his knife to slaughter his only son. Abraham believed God is able to raise Isaac even from the ashes on the altar (Heb 11). Therefore, God needed not to test such faith of Abraham.
Having faith in God and loving God does not necessarily always go together. For example, even demons believe in God and fear God but do not love God. The Scripture says it is hypocritical to love God with hearts far away from God. Now, in the eyes of God, Abraham's affection for Isaac grew, and now Isaac has become the love of Abraham, not YHWH.
(Peter had great faith in Jesus, but failed in loving Jesus more than his life. He made the great confession that Jesus was the Messiah and later said, Jesus, you have the words of eternal life, and to whom shall we go? Moreover, Peter, who had sworn that he would die with the Lord, out of fear for his life, swore thrice and denied Jesus. Later,to Peter, Jesus three times asked - Do you love me?)
God's command - "take your son, your only son, the one you love, Isaac" (= your laughter) contrasts with "love the Lord, your God with all your heart and with all your soul and with all your might" (Deut. 6:5).
The All-knowing God needs not test Abraham to see if Abraham would give up Isaac for God. Instead, the command was more of a wake-up call to Abraham, giving him an opportunity to find what was wrong with him just as God did with Adam - where are you? Commands and questions such as these have the effect of making listeners aware of their own condition. Abraham's immediate actions prove he took God's wake-up call very well, and he passed by showing his first love is YHWH, not Isaac (Gen 22: 3- 19).The command to Abraham of offering Isaac a burnt offering was a class in itself, a horrific one nonetheless.
- God did not test Enoch, who walked with God (=please God).
- The testing was for Abraham himself, not for YHWH, the All-Knowing.
- The testing was about Abraham's love for God rather than his faith in