How to set environment variables for running unit tests?
While running those tests I need to set some environment variables such as urls etc so that they point to the correct remote service.
How would I do this in rider? When I right click and "Run Tests", how do I make it to be aware of some files that can be interpreted as Environment variables?
Please sign in to leave a comment.
Hello @...,
You can set up environment variables, used during testing via Test Runner's Environment variables option. You can find more about this setting here.
Let us know if you have any questions.
Is it possible to load environment variables automatically from a file? E.g. an .env file?
Konstantin Miller You can use EnvironmentVariables in a runsettings file to do that.