nvim-neotest / neotest-go

MIT License
136 stars 43 forks source link

Specify environment variables #35

Open timofurrer opened 1 year ago

timofurrer commented 1 year ago

What is the proper way to specify some static environment variables to set when running a test for a single workspace?

sergii4 commented 1 year ago

why do you need any static env var and what preventing you from setting it up with

os.Setenv("FOO", "1")

?

mattwoberts commented 5 months ago

I need to do something similar... I have a .test.env that specifies some test env vars for testing my go app.

I use "godotenv" to run these tests:

godotenv -f .test.env go test ./... 

I'm trying to work out how I could do something like this that would allow me to run the tests in neotest - I can't think of anything obvious though that would allow me to do this?