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
  • 123,280
  • 14
  • 225
  • 444
thisisdude
  • 543
  • 1
  • 7
  • 31

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
  • 54,465
  • 21
  • 84
  • 248