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

feat: array assert support by key and value #745

Closed
wants to merge 10 commits into from

Conversation

ivan-velasco
Copy link
Contributor

@ivan-velasco ivan-velasco commented Nov 17, 2023

  • As the order of arrays in responses may vary, a new assertion has been introduced to perform lookups based on key and value.

Example:

- steps:
  - type: exec
    script: echo '[{"foo":"bar"}, {"foo2":"bar2"}, {"foo2":"bar3" }]'
    assertions:
      - result.systemoutjson ShouldContainKeyValue foo2 bar2

@aditi-malik
Copy link

  • As the order of arrays in responses may vary, a new assertion has been introduced to perform lookups based on key and value.

Example:

- steps:
  - type: exec
    script: echo '[{"foo":"bar"}, {"foo2":"bar2"}, {"foo2":"bar3" }]'
    assertions:
      - result.systemoutjson ShouldContainKeyValue foo2 bar2

This is a pretty helpful feature for our tests. Thanks @ivan-velasco for working on it.

@yesnault
Copy link
Member

Thank you @ivan-velasco for this proposal. Are you ok with https://github.com/ovh/venom/pull/747/files ?

@ivan-velasco
Copy link
Contributor Author

@yesnault yes this works for more scenarios ☑️

@yesnault
Copy link
Member

#747 merged.

@yesnault yesnault closed this Nov 23, 2023
@ivan-velasco ivan-velasco deleted the feature/assert-keyvalue-map branch April 25, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants