Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can you write one test and just change the environment variable?

See original GitHub issue

Is it possible that you can have one test in your *.http file and just simply just the variable on one iteration, and then another iteration have it change?

I have a use case for this as I want to run tests against a CDN and the Load Balancer behind the CDN. An example would be like:

// Iteration 1&2
GET {{cdnDns}}/healthcheck
GET {{lbDns}}/healthcheck

// Assertions should be the same, since response should be the same.

// Assert Result on both iterations

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

AnWebercommented, Dec 10, 2021

Yeah, the script Context is a real NodeJS Context. You can use all functionality of JavaScript, I prefer using indexOf but NodeJS should also support includes (not sure). You could JSON.stringify the complete response and use indexOf

AnWebercommented, Dec 11, 2021

If there are any questions just contact me again:-)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it possible to set environment variables for exactly one test?
I would like to set the x and y environment variable for this one test only. Is that possible? javascript · node.js ·...
Read more >
Edit environment variables programmatically in Unit Tests #3218
To support table-driven testing, I'd like to define a static list of data before executing tests. In some special cases, these data can...
Read more >
Environment Variables: What They Are and How To Use Them
Updating the environment variables when they're stored independently is simpler—you do not need to edit your source code and make a new release ......
Read more >
How To Set Environment Variables - Twilio
In the new window that opens, click on the Advanced tab and afterwards on the Environment Variables button in the bottom right of...
Read more >
Environment Variables | Cypress Documentation
You can set environment variables for specific suites or tests by passing the env values to the test configuration. Suite of test configuration....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found