I'm trying to assert that an array does not contain any of given elements. What i've tried so far:
* def foo = [1, 2, 3]
* match foo !contains [3, 4] # renders true, but i need it to be false --> !contains is not for this kind of assert
* match each foo !contains [3, 4] # error: datatypes don't match
* match foo !contains each [3, 4] # error: js syntax error
* match foo !contains any [3, 4] # error: !contains any not available
Is there a way to achive this kind of assert in Karate?
Yes, I myself get confused with
!containsand don't recommend it.I suggest you do a two-step filter. Use this as a reference:
Also refer this answer for more tips: https://stackoverflow.com/a/62567262/143475