Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error message for [contains only] match should be improved #2644

Open
ptrthomas opened this issue Jan 17, 2025 · 0 comments
Open

error message for [contains only] match should be improved #2644

ptrthomas opened this issue Jan 17, 2025 · 0 comments

Comments

@ptrthomas
Copy link
Member

Example:

* def response = [{a: 1}, {b: 2}]
* match response contains only [{a: 2}, {b: 2}]

results in super confusing and repetitive output. need to fix one of the loops or do a better diff algorithm at least for the error message

match failed: CONTAINS_ONLY
  $ | actual does not contain expected | actual array does not contain expected item - {"a":2} (LIST:LIST)
  [{"a":1},{"b":2}]
  [{"a":2},{"b":2}]

    $[1] | not equal | actual does not contain key - 'a' (MAP:MAP)
    {"b":2}
    {"a":2}

    $[0] | not equal | match failed for name: 'a' (MAP:MAP)
    {"a":1}
    {"a":2}

      $[0].a | not equal (NUMBER:NUMBER)
      1
      2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant