dotnet run has an option to provide custom arguments to an application
[[--] [application arguments]]
--
Delimits arguments to dotnet run from arguments for the application being run.
All arguments after this delimiter are passed to the application run.
So I would like to use it with expecto to provide custom arguments for tests for instance:
dotnet run --filter-test-case basic -- --env staging
but I'm getting an error
Most functions are public; you can call the parser on your selected arguments instead of passing them verbatim
Thus you can filter out env first
Also, your sample should be dotnet run -- --filter-test-case basic --env staging; because beware that -- is for dotnet, the binary, and not the Expecto parser
You can use env vars and pick them up in your code with Environment.GetEnvironmentVariable.
dotnet run
has an option to provide custom arguments to an application[[--] [application arguments]]
https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-run
So I would like to use it with expecto to provide custom arguments for tests for instance:
dotnet run --filter-test-case basic -- --env staging
but I'm getting an errorMaybe there is another way how to pass custom arguments to the tests?