The word translated as test
is exactly the same word found in Mark 1:13 to describe the work of Satan. The Pharisees, being in league with the Herodians (Mark 3:6), are looking for a way to have Jesus killed. That is why they ask their question to Jesus in this area beyond the River. John the Baptist was arrested and killed because he taught that it was wrong for Herod to have taken his brother’s wife. Presumably, the Pharisees were hoping that Jesus’ answer would somehow allow Herod to arrest him as well.
Alternatively, the Pharisees came to try and discredit Jesus. At the time of the New Testament, there were two schools of thinking among the Jewish leaders regarding divorce. The Shammai school considered divorce to only be allowable after some kind of sexual impropriety. The Hillel school allowed for divorce in lots of different circumstances. As a result, either a Yes or a No answer to their questions will arouse opposition by some part of the crowd. Most considered divorce to be allowable, but there were differences of opinion regarding the permitted grounds for divorce.1
2 And Pharisees came up and in order to test him asked, “Is it lawful for a man to divorce his wife?”