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

Single variable check value with random string renders only variable #84

Merged
merged 1 commit into from
Jun 2, 2021

Conversation

legander
Copy link
Collaborator

@legander legander commented Jun 2, 2021

Example

Following HAR fragment generates incomplete check

checks: [{
    "type": 1,
    "expression": "$.mixed",
    "condition": 2,
    "value": "${firstName} bar"
}]

check(response, {
  "$.mixed equals ${firstName} bar": (response) =>
    jsonpath
      .query(response.json(), "$.mixed")
      .some((value) => value === vars["firstName"]), // String "bar" has been omitted from the check value
});

Example to run node ./bin/har-to-k6.js example/multi-variable-check.har

@legander legander requested review from allansson and w1kman June 2, 2021 11:44
Copy link
Contributor

@w1kman w1kman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works + Looks good = 💚

@legander
Copy link
Collaborator Author

legander commented Jun 2, 2021

Thanks, will try this again now.. 🙏

@legander legander merged commit e7084bd into master Jun 2, 2021
@legander legander deleted the fix/omitted-template-str branch June 2, 2021 14:26
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.

None yet

2 participants