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

Feedback for “Getting Started with Bruno” #85

Open
jgiganti opened this issue Jul 22, 2024 · 0 comments
Open

Feedback for “Getting Started with Bruno” #85

jgiganti opened this issue Jul 22, 2024 · 0 comments

Comments

@jgiganti
Copy link

I am wondering how to handle an environment or collection variables in assert. I also cannot seem to get nested variables to work either. CompoundVar does not have the expected value of 123-456

I have the following case and the first assert fails as an assert but passes as a test. I believe it is because the first variable references an environment variable.

vars {
  AuthIdentityId2:   f38536f7-5aa8-e611-9965-f0921cdc2c4d
  AuthIdentityId: {{process.env.QA_AuthIdentityId}}
  BaseVar: 123
  CompoundVar: {{BaseVar}}-456
}

assert {
  res.body.Id: eq {{AuthIdentityId}}
  res.body.Id: eq {{AuthIdentityId2}}
}

test("Validate Data", function() {
    const body = res.getBody();
    expect(body.Id).to.equal(bru.getEnvVar('AuthIdentityId'));
    expect(body.Id).to.equal(bru.getEnvVar('AuthIdentityId2'));
}
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

No branches or pull requests

1 participant