Why would an omniscient God need to give anyone such a test?
God is omniscient but still gives us free will to decide whether or not to be part of His kingdom. He loves us enough to allow us to decide whether or not to return that love. He doesn’t force us to do anything. We make the choices but He makes the judgments.