Yes, the Lord knew ahead of time that Nineveh would repent and cry out to Him,...etc.
The Lord also knew that when He gave the Israelite's of the Exodus the laws to life, which if they disobeyed would then receive all the curses He described, would in that and in future generations choose the...