1

I'm asserting a response like this using karate.

"Ids": ["123456","123456","123457"]

Now I want to assert that my list doesn't contain the duplicate values (If there is a duplicate value, it should fail the test-case), is there any in built function which is supported by Karate or is there any JS who does the trick?

Ken White
  • 120,522
  • 13
  • 212
  • 426
thisisdude
  • 501
  • 5
  • 23

1 Answers1

1

Here you go: https://github.com/karatelabs/karate#karate-distinct

* def response = ["123456","123456","123457"]
* match response == karate.distinct(response)
Peter Thomas
  • 47,282
  • 14
  • 68
  • 196